Reset all logging tables together
authorAdam Wight <adam.wight@wikimedia.de>
Thu, 12 Sep 2019 15:19:57 +0000 (17:19 +0200)
committerAdam Wight <adam.wight@wikimedia.de>
Fri, 13 Sep 2019 11:03:07 +0000 (13:03 +0200)
For example, leftover cruft in `log_search` will cause spurious
associated_rev links between unrelated revisions and log entries.

Bug: T227849
Change-Id: Ie344522229e4142f2c61a267b4d693051b813236

tests/phpunit/MediaWikiIntegrationTestCase.php

index 373ea9a..ecd5c05 100644 (file)
@@ -1832,6 +1832,9 @@ abstract class MediaWikiIntegrationTestCase extends PHPUnit\Framework\TestCase {
                                'revision_actor_temp', 'slots', 'content', 'content_models', 'slot_roles',
                                'change_tag',
                        ];
+                       $loggingTables = [
+                               'logging', 'log_search', 'change_tag',
+                       ];
                        $coreDBDataTables = array_merge( $userTables, $pageTables );
 
                        // some groups of tables are connected such that if any is used, all should be cleared
@@ -1850,6 +1853,9 @@ abstract class MediaWikiIntegrationTestCase extends PHPUnit\Framework\TestCase {
                        if ( array_intersect( $tablesUsed, $pageTables ) ) {
                                $extraTables[] = $pageTables;
                        }
+                       if ( array_intersect( $tablesUsed, $loggingTables ) ) {
+                               $extraTables[] = $loggingTables;
+                       }
                        if ( $extraTables !== [] ) {
                                $tablesUsed = array_unique( array_merge( $tablesUsed, ...$extraTables ) );
                        }