Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wptrunner] Cycle testdriver event loop when testharness isn't loaded #48582

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tools/wptrunner/wptrunner/executors/executorchrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import collections
import os
import re
import time
from typing import Mapping, MutableMapping, Type

Expand Down Expand Up @@ -244,6 +245,18 @@ def setup(self, runner, protocol=None):
}
self.protocol.cdp.execute_cdp_command("Browser.setPermission", params)

def _get_next_message_classic(self, protocol, url, test_window):
try:
return super()._get_next_message_classic(protocol, url, test_window)
except error.JavascriptErrorException as js_error:
# TODO(crbug.com/340662810): Cycle testdriver event loop to work
# around `testharnessreport.js` flakily not loaded.
if re.search(r'window\.__wptrunner_process_next_event is not a function',
js_error.message):
time.sleep(0.05)
return None
raise


@_evaluate_leaks
class ChromeDriverPrintRefTestExecutor(WebDriverPrintRefTestExecutor,
Expand Down