From 3925eb3e9cc2cc1101818f3ac1841f3149b83438 Mon Sep 17 00:00:00 2001 From: Tryanks Date: Sat, 24 Oct 2026 15:22:17 +0800 Subject: [PATCH] Wait for a left cold thread's log read before asserting none is kept The subscription is answered from a bounded read of the log's tail while the whole log is still being read, so on a loaded Windows runner the read was still in flight when the test checked. --- crates/runtime/src/app/tests.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/runtime/src/app/tests.rs b/crates/runtime/src/app/tests.rs index 952df82b4..4ab87c69b 100644 --- a/crates/runtime/src/app/tests.rs +++ b/crates/runtime/src/app/tests.rs @@ -10212,7 +10212,10 @@ fn a_cold_thread_left_before_its_log_is_read_sends_no_window_and_keeps_no_log() send_to_host(&state, cx, 1, subscribe_events("left", None)); send_to_host(&state, cx, 2, unsubscribe_events("left")); state.read(|state| assert!(state.log_hydrations.contains_key("left"))); - let messages = answered(cx, 1); + let mut messages = answered(cx, 1); + // The whole log's read can finish after the subscription is answered. + cx.run_until(|state| state.log_hydrations.is_empty()); + messages.extend(cx.drain_outgoing()); assert!( messages @@ -10231,7 +10234,6 @@ fn a_cold_thread_left_before_its_log_is_read_sends_no_window_and_keeps_no_log() ); state.read(|state| { assert!(state.resident("left").is_none()); - assert!(state.log_hydrations.is_empty()); assert!(state.event_records.is_empty()); }); }