test: sync_waits_for_next lets events through

The 30 s memory status could land in its 2 s window and fail it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
cjkas 2026-10-24 13:40:08 +02:00
parent dc2f1478b6
commit 9fe05105ff

View file

@ -82,12 +82,17 @@ def test_sync_waits_for_next(connect):
c.recv() # hello c.recv() # hello
first = c.recv() first = c.recv()
assert first["t"] == 4 assert first["t"] == 4
# Without next nothing more comes, unless the whole sync fit one frame. # Without next no more sync comes, unless the whole sync fit one frame.
try: # Events may come meanwhile, such as the 30 s memory status.
more = c.recv(timeout=2) while True:
except TimeoutError: try:
more = c.recv(timeout=2)
except TimeoutError:
return
if more["t"] >= 128:
continue
assert more["t"] == 5, "a second sync frame came without next"
return return
assert more["t"] == 5, "a second sync frame came without next"
def test_resync_sends_it_all_again(connect, schema): def test_resync_sends_it_all_again(connect, schema):