Krinkle has submitted this change and it was merged.

Change subject: Tests: Fix race-condition broken mw.loader unit test
......................................................................


Tests: Fix race-condition broken mw.loader unit test

* testloader.php was resolving dependencies when it shouldn't
  the server *never* does that. That's handled by the client, which
  knows the state of what is and isn't module.

  Due to a race condition between:
  - handlePending() call from loader.state() call for
    load.phpmodules?=testMissing
  - asynchronous callback from mw.loader.using as dependencies
    are being resolved.

  It didn't expose any actual problem, the unit test was simply
  assuming that they would arrive in a certain order, when that isn't
  the case by design.

  Random failures are seen here:
  - https://integration.mediawiki.org/testswarm/user/mediawiki/
  - http://integration.wmflabs.org/testswarm/job/4

  > Module "test.missing" must have state "missing"
  > - "missing"
  > + "loading"
  -> Because callback was triggered from mw.loader.state() already
     it didn't get to the implement() call yet.

  > Module "test.use_missing" must have state "error"
  > - "error"
  > + "loading"
  -> (same reason)

  This is now fixed.

* Greatly simplified the mock load.php

Change-Id: I000ee726a062f6c6d630ad6c07cfc0b48d145d35
---
A tests/qunit/data/load.mock.php
D tests/qunit/data/testloader.php
M tests/qunit/suites/resources/mediawiki/mediawiki.test.js
3 files changed, 90 insertions(+), 94 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  jenkins-bot: Verified


--
To view, visit https://gerrit.wikimedia.org/r/13436
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I000ee726a062f6c6d630ad6c07cfc0b48d145d35
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <ttij...@wikimedia.org>
Gerrit-Reviewer: Hashar <has...@free.fr>
Gerrit-Reviewer: Krinkle <ttij...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to