Page MenuHomePhabricator

Flaky test BlockListPagerTest::testFormatValue
Closed, ResolvedPublicPRODUCTION ERROR

Description

1) BlockListPagerTest::testFormatValue with data set #5 (…)
=== Logs generated by test case
[wfDebug] [debug] SpecialPage::getContext called and $mContext is null. Return RequestContext::getMain(); for sanity
[GlobalTitleFail] [info] RequestContext::getTitle called by BlockListPager->formatValue/ContextSource->msg/RequestContext->msg/Message->setContext/RequestContext->getTitle with no title set.
===
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'infinite<br />0 minutes left'
+'infinite<br />-1 minute left'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/specials/pagers/BlockListPagerTest.php:32

Causing some CI false negatives on Travis CI (https://travis-ci.org/wikimedia/mediawiki/jobs/513327423). Haven't seen it locally or in Jenkins (yet).

Looks like a race condition due to reliance on real-time.

Event Timeline

You can use MWTimestamp::setFakeTime and must replace time() in BlockListPager with MWTimestamp::now()

dbarratt changed the subtype of this task from "Task" to "Bug Report".
dbarratt edited projects, added Anti-Harassment (Zayin - ז); removed Anti-Harassment.
dbarratt moved this task from Ready to In Progress on the Anti-Harassment (Zayin - ז) board.

Change 500462 had a related patch set uploaded (by Dbarratt; owner: Dbarratt):
[mediawiki/core@master] Fix flaky test BlockListPagerTest::testFormatValue

https://gerrit.wikimedia.org/r/500462

Change 500462 merged by jenkins-bot:
[mediawiki/core@master] Fix flaky test BlockListPagerTest::testFormatValue

https://gerrit.wikimedia.org/r/500462

dom_walden added a subscriber: dom_walden.

No failures on https://travis-ci.org/wikimedia/mediawiki/builds for the last 7 days.

The time left till block expiration appears to show accurately on Special:BlockList.

Umherirrender triaged this task as Medium priority.
mmodell changed the subtype of this task from "Bug Report" to "Production Error".Aug 28 2019, 11:07 PM