From 055e5684bc8eb042863bb0d362ea734240c10677 Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Fri, 9 Oct 2026 11:55:53 +0200 Subject: [PATCH] test(log): let the restarted silent-stream log end before stopping it --- tests/unit/test_logging.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/unit/test_logging.py b/tests/unit/test_logging.py index 13c3162a..ea076875 100644 --- a/tests/unit/test_logging.py +++ b/tests/unit/test_logging.py @@ -1270,8 +1270,11 @@ def generate_logs() -> Iterator[bytes]: assert not streaming_thread.is_alive() restarted_thread = streamed_log.start() assert restarted_thread is not streaming_thread - streamed_log.stop() + # The released server ends the stream after its line, so the thread finishes on its own. A `stop` before that + # line arrived would read the whole log, which this test does not serve. restarted_thread.join(timeout=5) + assert not restarted_thread.is_alive() + streamed_log.stop() @pytest.mark.usefixtures('propagate_stream_logs')