mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-02 12:02:09 +08:00
make onroad test more reliable
old-commit-hash: 8d28fcf9da4d6527eadc5add020e11edf26895d6
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user