From 44e97ead7bdcbf483e8ad14a2b6ff10f3ebbf4ee Mon Sep 17 00:00:00 2001 From: Adeeb <8762862+quillford@users.noreply.github.com> Date: Wed, 29 Jan 2020 09:44:14 -0800 Subject: [PATCH] process replay: fix output after timeout added (#1020) * process replay: fix output after timeout added * better error --- selfdrive/test/process_replay/process_replay.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/selfdrive/test/process_replay/process_replay.py b/selfdrive/test/process_replay/process_replay.py index ee07adf52bcafd..d71818e22672ac 100755 --- a/selfdrive/test/process_replay/process_replay.py +++ b/selfdrive/test/process_replay/process_replay.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 import os +import sys import threading import importlib import shutil @@ -21,7 +22,12 @@ def wait_for_event(evt): if not evt.wait(15): - raise Exception("Timeout reached. Thread likely crashed.") + if threading.currentThread().getName() == "MainThread": + # tested process likely died. don't let test just hang + raise Exception("Timeout reached. Tested process likely crashed.") + else: + # done testing this process, let it die + sys.exit(0) class FakeSocket: def __init__(self, wait=True):