From 8b149777e254369c8e41b0b13dfb3c3a955f9e58 Mon Sep 17 00:00:00 2001 From: Steve Traylen Date: Tue, 17 Nov 2026 20:18:22 +0100 Subject: [PATCH] test: wait for consumer before checking its read On ppc64le, test_pipeline_writer_relay_lends_only_while_a_producer_waits[True] failed with: AssertionError: assert 1114112 == 1163264 The child's last write unblocks once the relay has forwarded about capacity + 65536 bytes, 1114112 with 64 KiB pages. The consumer may still need more forwarded to reach first_read, and the test asserted as soon as the lend was returned, without waiting for it. Wait up to 5 seconds for the consumer to reach first_read. Its reads are capped there, so the equality check still holds. --- tests/test_utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_utils.py b/tests/test_utils.py index 659d175bb..e9125d380 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -539,6 +539,10 @@ def drain() -> None: time.sleep(0.01) assert not lends if pauses: + # The child can exit before the consumer has read all of its first page, so give it time. + deadline = time.monotonic() + 5 + while len(received) < first_read and time.monotonic() < deadline: + time.sleep(0.01) assert len(received) == first_read # cmd2's own writes follow what the child wrote, which is still pending. threading.Timer(0.3, resume.set).start()