Skip to content

Commit

Permalink
Bug 1523494 - Increase sw timeout in serviceworker_timeout.js mochite…
Browse files Browse the repository at this point in the history
…st r=daisuke

This mochitest had a very short SW timeout of 1 second, sometimes the worker would already be terminated before we could finish to attach a toolbox.
Increase the timeout to 4 seconds.

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

--HG--
extra : moz-landing-system : lando
  • Loading branch information
juliandescottes committed May 6, 2019
1 parent cb71937 commit f1c34cf
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

// This test will be idle for a long period to give a chance to the service worker to
// timeout.
requestLongerTimeout(2);
requestLongerTimeout(3);

/* import-globals-from helper-serviceworker.js */
Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-serviceworker.js", this);

const SW_TAB_URL = URL_ROOT + "resources/service-workers/empty-sw.html";
const SW_URL = URL_ROOT + "resources/service-workers/empty-sw.js";
const SW_TIMEOUT = 1000;
const SW_TIMEOUT = 4000;

// This is a migration from:
// https://searchfox.org/mozilla-central/source/devtools/client/aboutdebugging/test/browser_service_workers_timeout.js
Expand Down Expand Up @@ -59,11 +59,11 @@ add_task(async function() {
inspectButton.click();
await onToolboxReady;

// Wait for more 10 times the service worker timeout to check that the toolbox prevents
// Wait for more 5 times the service worker timeout to check that the toolbox prevents
// the worker from being destroyed.
await wait(SW_TIMEOUT * 10);
await wait(SW_TIMEOUT * 5);

// Check that the service worker is still running, even after waiting 10 times the
// Check that the service worker is still running, even after waiting 5 times the
// service worker timeout.
const hasInspectButton = !!getInspectButton(SW_URL, document);
ok(hasInspectButton, "Service worker target still has an inspect button");
Expand Down

0 comments on commit f1c34cf

Please sign in to comment.