Skip to content

Commit 534cdad

Browse files
committed
zephyr-cp tests: let a capture test stop the simulator at its duration
A display test with scheduled captures holds its last frame in `while True: time.sleep(1)`, so native_sim never exits on its own and wait_until_done() waits out the whole wall-clock timeout: every capture test takes exactly its duration, 346 s for the 26 display tests. Pass the duration as -stop_at so the simulator ends the run itself. In -no-rt the idle loop is fast-forwarded: gifio 60 s -> 2 s, the display suite 346 s -> 19 s, goldens unchanged. Realtime tests are left alone.
1 parent e6bf001 commit 534cdad

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

ports/zephyr-cp/tests/conftest.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,10 @@ def circuitpython(request, board, sim_id, native_sim_binary, native_sim_env, tmp
356356
f"--port-resets={port_resets}",
357357
)
358358
)
359+
# Capture tests hold their last frame forever; stop the simulator at the
360+
# test's duration in simulated time instead of waiting out the timeout.
361+
if capture_times_ns and not use_realtime:
362+
cmd.append(f"-stop_at={timeout}")
359363

360364
# Always preserve retained memory (e.g. the safe-mode saved word) in
361365
# in case of reboot.

0 commit comments

Comments
 (0)