ci: move manager test_startup_time to test_onroad (#34062)

* get

* fix

* now

* try

* better sign

* better

* better

* clean

* space

* fix

* more

* msg
This commit is contained in:
Maxime Desroches 2024-11-19 14:27:15 -08:00 committed by GitHub
parent 293c3fc57f
commit bf21e10d81
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 10 deletions

View File

@ -138,6 +138,7 @@ class TestOnroad:
proc = None
try:
manager_path = os.path.join(BASEDIR, "system/manager/manager.py")
cls.manager_st = time.monotonic()
proc = subprocess.Popen(["python", manager_path])
sm = messaging.SubMaster(['carState'])
@ -202,6 +203,10 @@ class TestOnroad:
with subtests.test(service=s):
assert len(msgs) >= math.floor(SERVICE_LIST[s].frequency*int(TEST_DURATION*0.8))
def test_manager_starting_time(self):
st = self.msgs['managerState'][0].logMonoTime / 1e9
assert (st - self.manager_st) < 10, f"manager.py took {st - self.manager_st}s to publish the first 'managerState' msg"
def test_cloudlog_size(self):
msgs = self.msgs['logMessage']

View File

@ -3,8 +3,6 @@ import pytest
import signal
import time
from parameterized import parameterized
from cereal import car
from openpilot.common.params import Params
import openpilot.system.manager.manager as manager
@ -37,14 +35,6 @@ class TestManager:
# TODO: ensure there are blacklisted procs until we have a dedicated test
assert len(BLACKLIST_PROCS), "No blacklisted procs to test not_run"
@parameterized.expand([(i,) for i in range(10)])
def test_startup_time(self, index):
start = time.monotonic()
os.environ['PREPAREONLY'] = '1'
manager.main()
t = time.monotonic() - start
assert t < MAX_STARTUP_TIME, f"startup took {t}s, expected <{MAX_STARTUP_TIME}s"
@pytest.mark.skip("this test is flaky the way it's currently written, should be moved to test_onroad")
def test_clean_exit(self, subtests):
"""