From 1c5d140761b44e0839480b41029f2fb4e15c99f4 Mon Sep 17 00:00:00 2001 From: Adam Wight Date: Thu, 12 Sep 2019 17:19:57 +0200 Subject: [PATCH] Reset all logging tables together 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/phpunit/MediaWikiIntegrationTestCase.php b/tests/phpunit/MediaWikiIntegrationTestCase.php index 373ea9a88d..ecd5c05b17 100644 --- a/tests/phpunit/MediaWikiIntegrationTestCase.php +++ b/tests/phpunit/MediaWikiIntegrationTestCase.php @@ -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 ) ); } -- 2.20.1