Bug 1427396 - Twice the dom.serviceWorkers.idle_timeout value for tests under dom/tests/mochitest/fetch/ to reduce the impact SW termination by timeout. r=perry
authorEden Chuang <echuang@mozilla.com>
Tue, 25 Jun 2019 15:21:15 +0000
changeset 542927 725ea89ab2d28d570b4311c5ba77069bc7fcf19c
parent 542926 308ea5eaadf1401186e31428f4528120b9803235
child 542928 1bc6ee0c6672a37dd40e4ca5e0c8331042bb2781
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersperry
bugs1427396
milestone69.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 1427396 - Twice the dom.serviceWorkers.idle_timeout value for tests under dom/tests/mochitest/fetch/ to reduce the impact SW termination by timeout. r=perry The ServiceWorker is terminated by idleWorkerTimer timeout, and in slow platforms/machines, it would cancel the uncompleted fetching and make unexpected behavior during running tests. The SW idle termination implementation has no defects, so the fix would just double the dom.serviceWorkers.idle_timeout to let fetchings have more chance to finish before idleWorkerTimer timeout. Differential Revision: https://phabricator.services.mozilla.com/D35555
dom/tests/mochitest/fetch/fetch_test_framework.js
dom/tests/mochitest/fetch/mochitest.ini
dom/tests/mochitest/fetch/sw_reroute.js
--- a/dom/tests/mochitest/fetch/fetch_test_framework.js
+++ b/dom/tests/mochitest/fetch/fetch_test_framework.js
@@ -15,17 +15,17 @@ function testScript(script) {
     window.isSWPresent = false;
   }
 
   function setupPrefs() {
     return new Promise(function(resolve, reject) {
       SpecialPowers.pushPrefEnv({
         "set": [["dom.serviceWorkers.enabled", true],
                 ["dom.serviceWorkers.testing.enabled", true],
-                ["dom.serviceWorkers.idle_timeout", 0],
+                ["dom.serviceWorkers.idle_timeout", 60000],
                 ["dom.serviceWorkers.exemptFromPerDomainMax", true]]
       }, resolve);
     });
   }
 
   function workerTest() {
     return new Promise(function(resolve, reject) {
       var worker = new Worker(workerWrapperUrl);
--- a/dom/tests/mochitest/fetch/mochitest.ini
+++ b/dom/tests/mochitest/fetch/mochitest.ini
@@ -45,43 +45,37 @@ support-files =
   !/dom/base/test/referrer_helper.js
   !/dom/base/test/referrer_testserver.sjs
   !/dom/promise/tests/test_webassembly_compile_sample.wasm
 prefs =
   javascript.options.streams=true
 
 [test_headers.html]
 [test_headers_sw_reroute.html]
-skip-if = toolkit == 'android' && !is_fennec # Bug 1427396
 [test_headers_mainthread.html]
 [test_fetch_basic.html]
 [test_fetch_basic_sw_reroute.html]
-skip-if = toolkit == 'android' && !is_fennec # Bug 1525959, 1427396
 [test_fetch_basic_sw_empty_reroute.html]
 [test_fetch_basic_http.html]
 [test_fetch_basic_http_sw_reroute.html]
-skip-if = toolkit == 'android' && !is_fennec || (os == "linux" && !debug) # Bug 1532023, 1427396
 [test_fetch_basic_http_sw_empty_reroute.html]
-skip-if = toolkit == 'android' && !is_fennec # Bug 1532097
 [test_fetch_cached_redirect.html]
 [test_fetch_cors.html]
 skip-if = toolkit == 'android' # Bug 1210282
 [test_fetch_cors_sw_reroute.html]
 skip-if = os == "linux" || (os == "win" && os_version == "10.0") || toolkit == 'android' # Bug 1210282
 [test_fetch_cors_sw_empty_reroute.html]
 skip-if = toolkit == 'android' # Bug 1210282
 [test_fetch_csp_block.html]
 [test_fetch_observer.html]
 [test_fetch_user_control_rp.html]
 [test_formdataparsing.html]
 skip-if = asan # Bug 1325942
 [test_formdataparsing_sw_reroute.html]
-skip-if = asan || toolkit == 'android' && !is_fennec || (os == "linux" && !debug) # Bug 1325942, 1427396
+skip-if = asan # Bug 1325942
 [test_request.html]
 [test_request_context.html]
 [test_request_sw_reroute.html]
-skip-if = toolkit == 'android' && !is_fennec # Bug 1427396
 [test_response.html]
 [test_response_sw_reroute.html]
-skip-if = toolkit == 'android' && !is_fennec # Bug 1427396
 [test_temporaryFileBlob.html]
 [test_readableStreams.html]
 [test_responseReadyForWasm.html]
--- a/dom/tests/mochitest/fetch/sw_reroute.js
+++ b/dom/tests/mochitest/fetch/sw_reroute.js
@@ -9,17 +9,18 @@ function testScript(script) {
     iframe = document.createElement("iframe");
     iframe.src = scope;
     document.body.appendChild(iframe);
   }
 
   SpecialPowers.pushPrefEnv({
     "set": [["dom.serviceWorkers.enabled", true],
             ["dom.serviceWorkers.testing.enabled", true],
-            ["dom.serviceWorkers.exemptFromPerDomainMax", true]]
+            ["dom.serviceWorkers.exemptFromPerDomainMax", true],
+            ["dom.serviceWorkers.idle_timeout", 60000]]
   }, function() {
     var scriptURL = location.href.includes("sw_empty_reroute.html")
                   ? "empty.js" : "reroute.js";
     navigator.serviceWorker.register(scriptURL, {scope: scope})
       .then(swr => waitForState(swr.installing, 'activated', swr))
       .then(setupSW);
   });
 }