From c267ab42ecfdaad13afa6c8c3ea04e86bddb0940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= Date: Tue, 21 Jun 2016 11:07:19 +0200 Subject: [PATCH] avocado.core.runner: Improve exception in case of unpickable status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the stacktrace.str_unpickable_objects to get more information on why the status was not send through queue. Signed-off-by: Lukáš Doktor --- avocado/core/runner.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/avocado/core/runner.py b/avocado/core/runner.py index 04e9bcb2..c3a8929a 100644 --- a/avocado/core/runner.py +++ b/avocado/core/runner.py @@ -34,6 +34,7 @@ from .status import mapping from ..utils import wait from ..utils import runtime from ..utils import process +from ..utils import stacktrace TEST_LOG = logging.getLogger("avocado.test") APP_LOG = logging.getLogger("avocado.app") @@ -298,13 +299,20 @@ class TestRunner(object): runtime.CURRENT_TEST = instance early_state = instance.get_state() early_state['early_status'] = True - queue.put(early_state) + try: + queue.put(early_state) + except Exception: + instance.error(stacktrace.str_unpickable_object(early_state)) self.result.start_test(early_state) try: instance.run_avocado() finally: - queue.put(instance.get_state()) + try: + state = instance.get_state() + queue.put(state) + except Exception: + instance.error(stacktrace.str_unpickable_object(state)) def setup(self): """ -- GitLab