From: daniel Date: Mon, 25 Mar 2019 10:47:53 +0000 (+0100) Subject: Fix MessagecacheTest::testLoadFromDB_fetchLatestRevision X-Git-Tag: 1.34.0-rc.0~2374^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=3620931e69afa4619f9cdaf2965b30d867bac63c;p=lhc%2Fweb%2Fwiklou.git Fix MessagecacheTest::testLoadFromDB_fetchLatestRevision This re-enables the "flaky" testLoadFromDB_fetchLatestRevision which was disabled because it failed on random patches for no apparent reason, as documented in T219042. The reason was an invalid timestamp in the test data, which caused the timestamp to default to "now", which was "sometimes" newer than the timestamp of the revision immediately created before. Bug: T219042 Bug: T218918 Change-Id: I38f4816b2dc735a7698626c7e3fe4a93ec95a9d1 --- diff --git a/tests/phpunit/includes/cache/MessageCacheTest.php b/tests/phpunit/includes/cache/MessageCacheTest.php index d8330ef57b..b03a3098d1 100644 --- a/tests/phpunit/includes/cache/MessageCacheTest.php +++ b/tests/phpunit/includes/cache/MessageCacheTest.php @@ -223,8 +223,6 @@ class MessageCacheTest extends MediaWikiLangTestCase { /** * Regression test for T218918 - * @group Broken - * @fixme Disabled per https://phabricator.wikimedia.org/T219042 */ public function testLoadFromDB_fetchLatestRevision() { // Create three revisions of the same message page. @@ -239,7 +237,7 @@ class MessageCacheTest extends MediaWikiLangTestCase { $importRevision = new WikiRevision( new HashConfig() ); $importRevision->setTitle( $r3->getTitle() ); $importRevision->setComment( 'Imported edit' ); - $importRevision->setTimestamp( '19991122334455' ); + $importRevision->setTimestamp( '19991122001122' ); $importRevision->setText( 'IMPORTED OLD TEST' ); $importRevision->setUsername( 'Alan Smithee' );