Skip to content

Commit

Permalink
Reinitialize BrowserManager's command queue after it is recreated (#4…
Browse files Browse the repository at this point in the history
…9693)

* Reinitialize BrowserManager's command queue after it is recreated

This will allow init_failed message be sent back to TestRunnerManager if
timeout happens when start the browser.

Also set the start browser timeout value to 65 seconds to align with the
default browser startup timeout value.

Bug: 381944656
  • Loading branch information
WeizhongX authored Dec 31, 2024
1 parent 266b838 commit 212b18d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tools/wptrunner/wptrunner/browsers/chrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ def update_properties():
return (["debug", "os", "processor"], {"os": ["version"], "processor": ["bits"]})

class ChromeBrowser(WebDriverBrowser):

# Chrome browser's default startup timeout is 60 seconds. Use 65 seconds here
# to allow error message be displayed if that happens.
init_timeout: float = 65

def __init__(self,
logger: StructuredLogger,
leak_check: bool = False,
Expand Down
4 changes: 3 additions & 1 deletion tools/wptrunner/wptrunner/testrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,9 @@ def _ensure_runner_stopped(self):
self.logger.debug("Recreating command queue")
self.command_queue.cancel_join_thread()
self.command_queue.close()
self.command_queue = mp.Queue()
# Reset the command queue for BrowserManager also as that won't
# be set again during retry.
self.browser.command_queue = self.command_queue = mp.Queue()
self.logger.debug("Recreating remote queue")
self.remote_queue.cancel_join_thread()
self.remote_queue.close()
Expand Down

0 comments on commit 212b18d

Please sign in to comment.