Skip to content

Commit fcfb8ff

Browse files
[wptrunner] Coerce script timeout to integer for non-wdspec tests (#58026)
https://crrev.com/c/7522226 seems to have caused Chrome on iOS results to disappear from wpt.fyi because the final timeout is [fractional]: ``` webdriver.error.InvalidArgumentException: invalid argument (500): Timeouts must be non-negative integers ``` This can be replicated with the right `wpt run --timeout-multiplier`, so avoid fractional timeouts in general. The spec for "Set Timeouts" isn't clear on how they should be handled (w3c/webdriver#1949), but the de facto behavior is to return "invalid argument". Note that the WebDriver client can still send fractional timeouts to test invalid values. [fractional]: https://chromium-swarm.appspot.com/task?id=7673a57e106bad10&w=true
1 parent 7a2bcbd commit fcfb8ff

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/wptrunner/wptrunner/executors/executorwebdriver.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ def execute_script(self, script, asynchronous=False, args=None):
8181
return method(script, args=args)
8282

8383
def set_timeout(self, timeout):
84-
self.webdriver.timeouts.script = timeout
84+
# TODO(webdriver/w3c#1949): The struct definition contradicts the
85+
# algorithm on whether fractional timeouts are allowed. There's not a
86+
# large difference for non-wdspec testing either way, so coerce to int
87+
# until there's a resolution.
88+
self.webdriver.timeouts.script = int(timeout)
8589

8690
def create_window(self, type=None, **kwargs):
8791
# WebKitGTK-based browsers have issues when the test is opened in a new tab instead of a separate window

0 commit comments

Comments
 (0)