make onroad test more reliable

old-commit-hash: 8d28fcf9da4d6527eadc5add020e11edf26895d6
This commit is contained in:
Adeeb Shihadeh
2021-01-25 22:06:33 -08:00
parent 6f8e6a8d73
commit 93c2c0784f
+5 -2
View File
@@ -8,6 +8,7 @@ from pathlib import Path
import cereal.messaging as messaging
from common.basedir import BASEDIR
from common.timeout import Timeout
from panda import Panda
from selfdrive.loggerd.config import ROOT
from selfdrive.test.helpers import set_params_enabled
from tools.lib.logreader import LogReader
@@ -79,6 +80,8 @@ class TestOnroad(unittest.TestCase):
os.environ['FINGERPRINT'] = "TOYOTA COROLLA TSS2 2019"
set_params_enabled()
Panda().reset()
initial_segments = set(Path(ROOT).iterdir())
# start manager and run openpilot for a minute
@@ -87,8 +90,8 @@ class TestOnroad(unittest.TestCase):
proc = subprocess.Popen(["python", manager_path])
sm = messaging.SubMaster(['carState'])
with Timeout(60, "controls didn't start"):
while not sm.updated['carState']:
with Timeout(150, "controls didn't start"):
while sm.rcv_frame['carState'] < 0:
sm.update(1000)
time.sleep(60)