Bug 1523494 - Increase sw timeout in serviceworker_timeout.js mochitest r=daisuke
authorJulian Descottes <jdescottes@mozilla.com>
Mon, 06 May 2019 11:37:26 +0000
changeset 472674 eae018d5c36464a8bc742160e9ee760dfa373b06
parent 472673 c8216edb37a946d516820743a831804512bbba4c
child 472675 af96bd1090b523679af7dc0274b5842b68adfcd6
push id35976
push useropoprus@mozilla.com
push dateMon, 06 May 2019 21:44:12 +0000
treeherdermozilla-central@e9f5f01d8b8e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaisuke
bugs1523494
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1523494 - Increase sw timeout in serviceworker_timeout.js mochitest 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
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_serviceworker_timeout.js
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_serviceworker_timeout.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_serviceworker_timeout.js
@@ -1,23 +1,23 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // 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
 
 /**
  * Test that service workers will _not_ timeout and be stopped when a toolbox is attached
  * to them. Feature implemented in Bug 1228382.
  */
@@ -54,21 +54,21 @@ add_task(async function() {
   const inspectButton = getInspectButton(SW_URL, document);
   ok(!!inspectButton, "Service worker target has an inspect button");
 
   info("Click on inspect and wait for the toolbox to open");
   const onToolboxReady = gDevTools.once("toolbox-ready");
   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");
 
   info("Destroy the toolbox");
   const devtoolsTab = gBrowser.selectedTab;
   await closeAboutDevtoolsToolbox(document, devtoolsTab, window);