diff --git a/avocado/job.py b/avocado/job.py index 6e9d70320bc89396b883fb3647a0673ae730b104..cf60317f30104c42a70db4e230124559b568b5cb 100644 --- a/avocado/job.py +++ b/avocado/job.py @@ -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():