提交 04dd914e 编写于 作者: C Cleber Rosa

job main loop: use the test 'running' attribute

So that multiple test states can be received by the main loop, but
only if the test is finished we break out from the loop.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 16894952
......@@ -124,6 +124,10 @@ class TestRunner(object):
:param queue: Multiprocess queue.
:type queue: :class`multiprocessing.Queue` instance.
"""
instance = self.load_test(params)
queue.put(instance.get_state())
def timeout_handler(signum, frame):
e_msg = "Timeout reached waiting for %s to end" % instance
raise exceptions.TestTimeoutError(e_msg)
......@@ -138,9 +142,6 @@ class TestRunner(object):
instance.text_output = log_file_obj.read()
sys.exit(error_codes.numeric_status['AVOCADO_JOB_INTERRUPTED'])
instance = self.load_test(params)
queue.put(instance.get_state())
signal.signal(signal.SIGUSR1, timeout_handler)
signal.signal(signal.SIGINT, interrupt_handler)
......@@ -205,7 +206,8 @@ class TestRunner(object):
test_state = q.get(timeout=cycle_timeout)
if test_state is not None:
break
if not test_state['running']:
break
except Queue.Empty:
if p.is_alive():
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册