mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 13:52:15 +01:00
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:
parent
dc2f1478b6
commit
9fe05105ff
1 changed files with 10 additions and 5 deletions
|
|
@ -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):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue