jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/343770 )
Change subject: phpunit: Fix RecentChangeTest failure when coverage is enabled ...................................................................... phpunit: Fix RecentChangeTest failure when coverage is enabled From <https://integration.wikimedia.org/ci/job/mediawiki-core-code-coverage/> 2) RecentChangeTest::testIsInRCLifespan with data set #0 (6000, 1490019080, 0, true) Failed asserting that false matches expected true. 3) RecentChangeTest::testIsInRCLifespan with data set #3 (3000, 1490016080, 6000, true) Failed asserting that false matches expected true. Change-Id: I309bb229542f3af62e3e83025d88e77ecb55cd31 --- M tests/phpunit/includes/changes/RecentChangeTest.php 1 file changed, 9 insertions(+), 6 deletions(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/includes/changes/RecentChangeTest.php b/tests/phpunit/includes/changes/RecentChangeTest.php index 995c4be..68f9079 100644 --- a/tests/phpunit/includes/changes/RecentChangeTest.php +++ b/tests/phpunit/includes/changes/RecentChangeTest.php @@ -88,15 +88,14 @@ } /** - * 50 mins and 100 mins are used here as the tests never take that long! * @return array */ public function provideIsInRCLifespan() { return [ - [ 6000, time() - 3000, 0, true ], - [ 3000, time() - 6000, 0, false ], - [ 6000, time() - 3000, 6000, true ], - [ 3000, time() - 6000, 6000, true ], + [ 6000, -3000, 0, true ], + [ 3000, -6000, 0, false ], + [ 6000, -3000, 6000, true ], + [ 3000, -6000, 6000, true ], ]; } @@ -104,8 +103,12 @@ * @covers RecentChange::isInRCLifespan * @dataProvider provideIsInRCLifespan */ - public function testIsInRCLifespan( $maxAge, $timestamp, $tolerance, $expected ) { + public function testIsInRCLifespan( $maxAge, $offset, $tolerance, $expected ) { $this->setMwGlobals( 'wgRCMaxAge', $maxAge ); + // Calculate this here instead of the data provider because the provider + // is expanded early on and the full test suite may take longer than 100 minutes + // when coverage is enabled. + $timestamp = time() + $offset; $this->assertEquals( $expected, RecentChange::isInRCLifespan( $timestamp, $tolerance ) ); } -- To view, visit https://gerrit.wikimedia.org/r/343770 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I309bb229542f3af62e3e83025d88e77ecb55cd31 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Krinkle <krinklem...@gmail.com> Gerrit-Reviewer: Reedy <re...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits