mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-12-02 01:53:40 +08:00
loggerd: fix test_loggerd encoderd flake (#39276)
This commit is contained in:
committed by
firestar5683
parent
4960ad55f8
commit
36efabddc8
@@ -120,6 +120,10 @@ class TestLoggerd(OpenpilotTestCase):
|
||||
(VisionStreamType.VISION_STREAM_WIDE_ROAD, frame_spec, "wideRoadCameraState"),
|
||||
]
|
||||
|
||||
# set env before start_listener(), its thread calls getenv() which races with setenv()
|
||||
os.environ["LOGGERD_TEST"] = "1"
|
||||
os.environ["LOGGERD_SEGMENT_LENGTH"] = str(segment_length)
|
||||
|
||||
sm = messaging.SubMaster(["narrowRoadEncodeData"])
|
||||
pm = messaging.PubMaster([s for _, _, s in streams] + ["rawAudioData"])
|
||||
vipc_server = VisionIpcServer("camerad")
|
||||
@@ -127,8 +131,6 @@ class TestLoggerd(OpenpilotTestCase):
|
||||
vipc_server.create_buffers_with_sizes(stream_type, 40, *(frame_spec))
|
||||
vipc_server.start_listener()
|
||||
|
||||
os.environ["LOGGERD_TEST"] = "1"
|
||||
os.environ["LOGGERD_SEGMENT_LENGTH"] = str(segment_length)
|
||||
managed_processes["loggerd"].start()
|
||||
managed_processes["encoderd"].start()
|
||||
assert pm.wait_for_readers_to_update("narrowRoadCameraState", timeout=5, dt=0.001)
|
||||
|
||||
Reference in New Issue
Block a user