Skip to content

Commit

Permalink
Merge pull request #143 from w3c/jgraham/debugger_exit
Browse files Browse the repository at this point in the history
Don't block forever when a debugger exits.
  • Loading branch information
jgraham committed Sep 2, 2015
2 parents 8305fd8 + 3ec1aa2 commit 0fa6b5e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions wptrunner/testrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ def __init__(self, suite_name, test_queue, test_source_cls, browser_cls, browser

self.browser = None
self.browser_pid = None
self.browser_started = False

# Flags used to shut down this thread if we get a sigint
self.parent_stop_flag = stop_flag
Expand Down Expand Up @@ -279,6 +280,10 @@ def run(self):
if commands[command](*data) is Stop:
break
else:
if (self.debug_info and self.debug_info.interactive and
self.browser_started and not browser.is_alive()):
self.logger.debug("Debugger exited")
break
if not self.test_runner_proc.is_alive():
if not self.command_queue.empty():
# We got a new message so process that
Expand Down Expand Up @@ -355,6 +360,7 @@ def init_failed():
succeeded = False
else:
succeeded = True
self.browser_started = True

# This has to happen after the lock is released
if not succeeded:
Expand Down Expand Up @@ -457,6 +463,7 @@ def stop_runner(self):
return
try:
self.browser.stop()
self.browser_started = False
if self.test_runner_proc.is_alive():
self.send_message("stop")
self.ensure_runner_stopped()
Expand Down

0 comments on commit 0fa6b5e

Please sign in to comment.