Closed Bug 1479955 Opened 6 years ago Closed 6 years ago

MarionetteTestharnessExecutor sets a timeout of 0 when running with a debugger

Categories

(Testing :: web-platform-tests, defect)

Version 3
defect
Not set
normal

Tracking

(firefox63 fixed)

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: roc, Unassigned)

Details

MarionetteTestharnessExecutor has this code:

    timeout = (test.timeout * self.timeout_multiplier if self.debug_info is None
               else None)

Clearly the intent is to avoid setting a timeout if a debugger is being used. However, this None later gets converted to "null" when passed as %(timeout)s in testharness_webdriver.js. That script then passes null directly to window.setTimeout(), which treats it as 0. I.e. instead of suppressing the timeout, it fires immediately.

A patch like this is probably needed:

diff --git a/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/testharness_webdriver.js b/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/testharness_webdriver.js
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/testharness_webdriver.js
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/testharness_webdriver.js
@@ -12,12 +12,14 @@ window.setMessageListener = function(fun
 };
 
 window.setMessageListener(function(event) {
   window.message_queue.push(event);
 });
 
 window.win = window.open("%(abs_url)s", "%(window_id)s");
 
-window.timer = setTimeout(function() {
-  window.win.timeout();
-  window.win.close();
-}, %(timeout)s);
+if (%(timeout)s != null) {
+  window.timer = setTimeout(function() {
+    window.win.timeout();
+    window.win.close();
+  }, %(timeout)s);
+}
James, could you have a look?
Component: Marionette → web-platform-tests
Flags: needinfo?(james)
Oops. The patch looks right and worked when I tested it so I applied it with --author=roc@ocallahan.org. I hope that's OK.
Flags: needinfo?(james)
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b069f55fad2c
MarionetteTestharnessExecutor sets a timeout of 0 when running with a debugger, r=jgraham
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/12257 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
https://hg.mozilla.org/mozilla-central/rev/b069f55fad2c
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.