Skip to content
This repository has been archived by the owner on Aug 20, 2018. It is now read-only.

Commit

Permalink
Bug 962495 - [mozrunner] Calling runner.start() with a timeout or out…
Browse files Browse the repository at this point in the history
…putTimeout, it doesn't handle stopped process. r=hskupin
  • Loading branch information
Jarek Śmiejczak authored and whimboo committed Jan 29, 2014
1 parent ec1fbe2 commit b7f3c9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 5 additions & 1 deletion mozrunner/mozrunner/base.py
Expand Up @@ -120,7 +120,11 @@ def is_running(self):
returns True if the process is active
"""
return self.process_handler is not None
if isinstance(self.process_handler, subprocess.Popen):
return self.process_handler.poll() is None
elif isinstance(self.process_handler, ProcessHandler):
return self.process_handler.proc.poll() is None
return False


def stop(self, sig=None):
Expand Down
2 changes: 0 additions & 2 deletions mozrunner/tests/test_start.py
Expand Up @@ -30,15 +30,13 @@ def test_start_process_called_twice(self):
finally:
process_handler.kill()

@unittest.skip("Bug 962495 - Mozrunner fails in handling timeout parameter")
def test_start_with_timeout(self):
"""Start the process and set a timeout"""
self.runner.start(timeout=2)
sleep(5)

self.assertFalse(self.runner.is_running())

@unittest.skip("Bug 962495 - Mozrunner fails in handling outputTimeout parameter")
def test_start_with_outputTimeout(self):
"""Start the process and set a timeout"""
self.runner.start(outputTimeout=2)
Expand Down

0 comments on commit b7f3c9c

Please sign in to comment.