Skip to content

Commit

Permalink
process replay: fix output after timeout added (#1020)
Browse files Browse the repository at this point in the history
* process replay: fix output after timeout added

* better error
  • Loading branch information
adeebshihadeh authored Jan 29, 2020
1 parent 8507e68 commit 44e97ea
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion selfdrive/test/process_replay/process_replay.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
import os
import sys
import threading
import importlib
import shutil
Expand All @@ -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):
Expand Down

0 comments on commit 44e97ea

Please sign in to comment.