Skip to content

Commit 40ca1d4

Browse files
[wptrunner] Fix missing WebDriverCrashtestExecutor.is_alive() method
The `TestDriverExecutorMixin` introduced for #13183 requires an `is_alive()` executor method, but we forgot to add one for `WebDriverCrashtestExecutor` [0]: ``` 2025-03-17 05:05:54.246 INFO Starting runner ▶ ERROR [expected PASS] external/wpt/html/semantics/forms/the-select-element/customizable-select/nested-select-crash.html └ → Traceback (most recent call last): File "/Volumes/Work/s/w/ith4ri8l3q/external/wpt/tools/wptrunner/wptrunner/executors/executorwebdriver.py", line 831, in run_func self.result = True, self.func(self.protocol, self.url, self.timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Volumes/Work/s/w/ith4ri8l3q/external/wpt/tools/wptrunner/wptrunner/executors/executorwebdriver.py", line 1239, in do_crashtest self.run_testdriver(protocol, url, timeout) File "/Volumes/Work/s/w/ith4ri8l3q/external/wpt/tools/wptrunner/wptrunner/executors/executorwebdriver.py", line 938, in run_testdriver is_alive = self.is_alive() ^^^^^^^^^^^^^ AttributeError: 'WebDriverCrashtestExecutor' object has no attribute 'is_alive' ``` Fixed by just inlining `protocol.is_alive()`, which is the same for all executor types. [0]: https://chromium-swarm.appspot.com/task?id=6fbcb3db3c2e6410
1 parent 2ff0370 commit 40ca1d4

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

Diff for: tools/wptrunner/wptrunner/executors/executorwebdriver.py

+1-9
Original file line numberDiff line numberDiff line change
@@ -859,8 +859,6 @@ def run_func(self):
859859
self.result_flag.set()
860860

861861

862-
# TODO(web-platform-tests/wpt#13183): Add testdriver support to the other
863-
# executors.
864862
class TestDriverExecutorMixin:
865863
def __init__(self, script_resume: str):
866864
self.script_resume = script_resume
@@ -935,7 +933,7 @@ async def process_bidi_event(method, params):
935933
# https://github.com/w3c/webdriver/issues/1308
936934
if not isinstance(test_driver_message, list) or len(test_driver_message) != 3:
937935
try:
938-
is_alive = self.is_alive()
936+
is_alive = protocol.is_alive()
939937
except webdriver_error.WebDriverException:
940938
is_alive = False
941939
if not is_alive:
@@ -990,9 +988,6 @@ def __init__(self, logger, browser, server_config, timeout_multiplier=1,
990988
self.close_after_done = close_after_done
991989
self.cleanup_after_test = cleanup_after_test
992990

993-
def is_alive(self):
994-
return self.protocol.is_alive()
995-
996991
def on_environment_change(self, new_environment):
997992
if new_environment["protocol"] != self.last_environment["protocol"]:
998993
self.protocol.testharness.load_runner(new_environment["protocol"])
@@ -1090,9 +1085,6 @@ def __init__(self, logger, browser, server_config, timeout_multiplier=1,
10901085
def reset(self):
10911086
self.implementation.reset()
10921087

1093-
def is_alive(self):
1094-
return self.protocol.is_alive()
1095-
10961088
def do_test(self, test):
10971089
width_offset, height_offset = self.protocol.webdriver.execute_script(
10981090
"""return [window.outerWidth - window.innerWidth,

0 commit comments

Comments
 (0)