Page MenuHomePhabricator

Flaky test BlockListPagerTest::testFormatValue
Closed, ResolvedPublicPRODUCTION ERROR


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'

Causing some CI false negatives on Travis CI ( 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

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

dom_walden subscribed.

No failures on 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