mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-09 07:32:06 +08:00
reliability? (#2722)
old-commit-hash: e715b1ac54b752aae8b2ebf0ea58454a6188b127
This commit is contained in:
@@ -6,7 +6,6 @@ import subprocess
|
||||
|
||||
import cereal.messaging as messaging
|
||||
from common.basedir import BASEDIR
|
||||
from common.params import Params
|
||||
from selfdrive.test.helpers import set_params_enabled
|
||||
|
||||
def cputime_total(ct):
|
||||
@@ -66,20 +65,22 @@ def test_cpu_usage():
|
||||
cpu_ok = False
|
||||
|
||||
# start manager
|
||||
os.environ['SKIP_FW_QUERY'] = "1"
|
||||
manager_path = os.path.join(BASEDIR, "selfdrive/manager.py")
|
||||
manager_proc = subprocess.Popen(["python", manager_path])
|
||||
try:
|
||||
proc_sock = messaging.sub_sock('procLog', conflate=True, timeout=2000)
|
||||
cs_sock = messaging.sub_sock('controlsState', conflate=True)
|
||||
|
||||
# wait until everything's started
|
||||
start_time = time.monotonic()
|
||||
while time.monotonic() - start_time < 210:
|
||||
if Params().get("CarParams") is not None:
|
||||
while time.monotonic() - start_time < 240:
|
||||
msg = messaging.recv_sock(cs_sock, wait=True)
|
||||
if msg is not None:
|
||||
break
|
||||
time.sleep(2)
|
||||
|
||||
# take first sample
|
||||
time.sleep(5)
|
||||
time.sleep(15)
|
||||
first_proc = messaging.recv_sock(proc_sock, wait=True)
|
||||
if first_proc is None:
|
||||
raise Exception("\n\nTEST FAILED: progLog recv timed out\n\n")
|
||||
@@ -97,7 +98,6 @@ def test_cpu_usage():
|
||||
|
||||
if __name__ == "__main__":
|
||||
set_params_enabled()
|
||||
Params().delete("CarParams")
|
||||
|
||||
passed = False
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user