Skip to content

Commit

Permalink
[wptrunner] Guard against no browser during TestRunnerManager clean…
Browse files Browse the repository at this point in the history
…up (#48265)

Even with no browser, `stop_runner()` should still call `cleanup()` in
case there are other resources to clean up.

Fixes #48263
  • Loading branch information
jonathan-j-lee committed Sep 19, 2024
1 parent 28c8706 commit b23d75f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/wptrunner/wptrunner/testrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,8 @@ def stop_runner(self, force=False):
self._ensure_runner_stopped()
# TODO(web-platform-tests/wpt#48030): Consider removing the
# `stop(force=...)` argument.
self.browser.stop(force=True)
if self.browser:
self.browser.stop(force=True)
except (OSError, PermissionError):
self.logger.error("Failed to stop either the runner or the browser process",
exc_info=True)
Expand Down

0 comments on commit b23d75f

Please sign in to comment.