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.
# Events may come meanwhile, such as the 30 s memory status.
while True:
try: try:
more = c.recv(timeout=2) more = c.recv(timeout=2)
except TimeoutError: except TimeoutError:
return return
if more["t"] >= 128:
continue
assert more["t"] == 5, "a second sync frame came without next" assert more["t"] == 5, "a second sync frame came without next"
return
def test_resync_sends_it_all_again(connect, schema): def test_resync_sends_it_all_again(connect, schema):