Page MenuHomePhabricator

ResourceLoaderModuleTest::testDefinitionSummary race condition due to changing "msgBlobMtime"
Closed, ResolvedPublic

Description

The ResourceLoaderModuleTest::testDefinitionSummary test failed on an unrelated patch sent to mediawiki/core master branch. I rewrote the json diff to make it easier to read:

ResourceLoaderModuleTest::testDefinitionSummary
Order of messages is insignificant
Failed asserting that two strings are equal.

--- prev	2015-07-10 13:13:49.000000000 +0200
+++ new	2015-07-10 13:14:07.000000000 +0200
@@ -1,42 +1,42 @@
 {
     "0": {
         "fileMtimes": [
             1,
             1
         ],
-        "msgBlobMtime": "1436525996",
+        "msgBlobMtime": "1436525997",
         "options": {
             "debugRaw": true,
             "debugScripts": [],
             "dependencies": [
                 "jquery",
                 "mediawiki"
             ],
             "group": null,
             "languageScripts": [],
             "loaderScripts": [],
             "localBasePath": "/mnt/jenkins-workspace/workspace/mediawiki-phpunit-zend/src",
             "messages": [
                 "hello",
                 "world"
             ],
             "position": "bottom",
             "raw": false,
             "remoteBasePath": "http://localhost/wiki",
             "scripts": [
                 "foo.js",
                 "bar.js"
             ],
             "skinScripts": [],
             "skinStyles": [],
             "skipFunction": null,
             "styles": [],
             "targets": [
                 "desktop"
             ],
             "templates": []
         }
     },
     "_cacheEpoch": "20140101000000",
     "_class": "ResourceLoaderFileModule"
 }

/mnt/jenkins-workspace/workspace/mediawiki-phpunit-zend/src/tests/phpunit/includes/resourceloader/ResourceLoaderModuleTest.php:51
/mnt/jenkins-workspace/workspace/mediawiki-phpunit-zend/src/tests/phpunit/MediaWikiTestCase.php:131

The reason is that msgBlobMtime is different :-( It should probably be set properly or filtered out / ignored.

Event Timeline

hashar created this task.Jul 10 2015, 11:15 AM
hashar raised the priority of this task from to Needs Triage.
hashar updated the task description. (Show Details)
hashar added a subscriber: hashar.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 10 2015, 11:15 AM

Change 223803 had a related patch set uploaded (by Krinkle):
resourceloader: Make tests less susceptible to timestamp races

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

Krinkle claimed this task.Jul 10 2015, 2:00 PM
Krinkle triaged this task as Normal priority.
Krinkle added a project: Performance-Team.
Krinkle set Security to None.
Krinkle moved this task from Inbox to Doing on the Performance-Team board.
Krinkle added a subscriber: Gilles.

Change 223803 merged by jenkins-bot:
resourceloader: Make tests less susceptible to timestamp races

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