Tests: loggerd reduce iterations (#29713)

* reduce those iterations

* sleep time could be decreased too

* in case it's negative
old-commit-hash: a5ef9febb9
beeps
Justin Newberry 2 years ago committed by GitHub
parent 16a3f0f67f
commit e3053e6659
  1. 4
      system/loggerd/tests/test_loggerd.py

@ -154,7 +154,6 @@ class TestLoggerd(unittest.TestCase):
vipc_server.create_buffers_with_sizes(stream_type, 40, False, *(frame_spec))
vipc_server.start_listener()
for _ in range(5):
num_segs = random.randint(2, 5)
length = random.randint(1, 3)
os.environ["LOGGERD_SEGMENT_LENGTH"] = str(length)
@ -164,6 +163,7 @@ class TestLoggerd(unittest.TestCase):
fps = 20.0
for n in range(1, int(num_segs*length*fps)+1):
time_start = time.monotonic()
for stream_type, frame_spec, state in streams:
dat = np.empty(frame_spec[2], dtype=np.uint8)
vipc_server.send(stream_type, dat[:].flatten().tobytes(), n, n/fps, n/fps)
@ -172,7 +172,7 @@ class TestLoggerd(unittest.TestCase):
frame = getattr(camera_state, state)
frame.frameId = n
pm.send(state, camera_state)
time.sleep(1.0/fps)
time.sleep(max((1.0/fps) - (time.monotonic() - time_start), 0))
managed_processes["loggerd"].stop()
managed_processes["encoderd"].stop()

Loading…
Cancel
Save