From 9fe05105ff07294d3169d8855b7e309c115e1fca Mon Sep 17 00:00:00 2001 From: cjkas Date: Sat, 24 Oct 2026 13:40:08 +0200 Subject: [PATCH] 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 --- test/e2e/test_sync.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/test/e2e/test_sync.py b/test/e2e/test_sync.py index 6c30ec7..c9acfa8 100644 --- a/test/e2e/test_sync.py +++ b/test/e2e/test_sync.py @@ -82,12 +82,17 @@ def test_sync_waits_for_next(connect): c.recv() # hello first = c.recv() assert first["t"] == 4 - # Without next nothing more comes, unless the whole sync fit one frame. - try: - more = c.recv(timeout=2) - except TimeoutError: + # 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: + 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 - assert more["t"] == 5, "a second sync frame came without next" def test_resync_sends_it_all_again(connect, schema):