gecko-dev/testing/modules
Emilio Cobos Álvarez 2c2c3c23dd Bug 1595285 - Fix TestUtils.waitForCondition to not use setInterval. r=mak
The test that is timing out with these patches does something relatively simple:

  await TestUtils.waitForCondition(async function() {
    let color = await ContentTask.spawn(browserWindow, async function() {
      /* Do stuff... */
    });
    return color == something;
  });

  await closeWindow(browserWindow);

Turns out that this can intermittently leak the window due to waitForCondition
using setInterval. setInterval can schedule multiple tasks while awaiting for
the inner ContentTask.

What this means, is that we may still have a ContentTask awaiting us when we get
to close the window. Closing the window makes the ContentTask not finish, and
thus we leak a promise keeping alive the window in gPromises:

  https://searchfox.org/mozilla-central/rev/6566d92dd46417a2f57e75c515135ebe84c9cef5/testing/mochitest/BrowserTestUtils/ContentTask.jsm#24

Which means that we keep alive the window all the way until shutdown.

Fix it by ensuring that we only run one task at a time.

Differential Revision: https://phabricator.services.mozilla.com/D52833

--HG--
extra : moz-landing-system : lando
2019-11-13 18:24:02 +00:00
..
tests Bug 1582785 - Enable some xpcshell tests on Android; r=geckoview-reviewers,agi 2019-09-23 22:43:55 +00:00
AppData.jsm Bug 1561435 - Format testing/, a=automatic-formatting 2019-07-05 11:01:24 +02:00
AppInfo.jsm Bug 1561435 - Format testing/, a=automatic-formatting 2019-07-05 11:01:24 +02:00
Assert.jsm Bug 1561435 - Format testing/, a=automatic-formatting 2019-07-05 11:01:24 +02:00
CoverageUtils.jsm Bug 1561435 - Format testing/, a=automatic-formatting 2019-07-05 11:01:24 +02:00
FileTestUtils.jsm Bug 1561435 - Format testing/, a=automatic-formatting 2019-07-05 11:01:24 +02:00
MockRegistrar.jsm Bug 1561435 - Format testing/, a=automatic-formatting 2019-07-05 11:01:24 +02:00
MockRegistry.jsm Bug 1561435 - Format testing/, a=automatic-formatting 2019-07-05 11:01:24 +02:00
Sinon.jsm Bug 1561435 - Format testing/, a=automatic-formatting 2019-07-05 11:01:24 +02:00
StructuredLog.jsm Bug 1561435 - Format testing/, a=automatic-formatting 2019-07-05 11:01:24 +02:00
TestUtils.jsm Bug 1595285 - Fix TestUtils.waitForCondition to not use setInterval. r=mak 2019-11-13 18:24:02 +00:00
ajv-4.1.1.js
moz.build Bug 1532514 - Update sinon to v7.2.7. r=markh 2019-03-12 19:32:40 +00:00
sinon-7.2.7.js Bug 1532514 - Update sinon to v7.2.7. r=markh 2019-03-12 19:32:40 +00:00