diff --git a/quest/m0/test-flakes-3/ffi-shutdown-in-place-poll.md b/quest/m0/test-flakes-3/ffi-shutdown-in-place-poll.md deleted file mode 100644 index d3b1d470c9..0000000000 --- a/quest/m0/test-flakes-3/ffi-shutdown-in-place-poll.md +++ /dev/null @@ -1,13 +0,0 @@ -# [S] moq-ffi's in-place shutdown test holds under load - -## Goal - -`test::shutdown_waits_for_an_in_place_poll` in `rs/moq-ffi/src/test.rs` passes however loaded the machine is. - -## Plan - -It failed once under a full `just check` on 2026-11-18 at load average 31, on a branch that touched no moq-ffi code ([moq-dev/moq#9123](https://github.com/moq-dev/moq/pull/9123)), and passed six runs alone. -The child process aborted with "a 994.299µs timer fired on the host clock, which KIO_DENY_HOST_TIMERS=1 denies": the held poll's `kio::clock::sleep(Duration::from_millis(1))` fired on the host clock before shutdown cancelled it. -Reproduce it under load first, then drive that sleep from a mocked clock, or wait on an event instead, so the test still shows that only the shutdown finishes the held call. - -Decided 2026-11-19 (coordinator, maintainer away, merge granted): keep this follow-up. diff --git a/rs/moq-ffi/src/test.rs b/rs/moq-ffi/src/test.rs index 5f104a28ee..5aedf29f41 100644 --- a/rs/moq-ffi/src/test.rs +++ b/rs/moq-ffi/src/test.rs @@ -8886,15 +8886,16 @@ fn shutdown_waits_for_an_in_place_poll() { let (entered, entered_rx) = std::sync::mpsc::channel(); let (release, release_rx) = std::sync::mpsc::channel::<()>(); - let poller = std::thread::spawn(move || { + let poller = std::thread::spawn(move || -> Result<(), MoqError> { let task = crate::ffi::Task::new(()); let run = task.run(|_| async move { entered.send(()).unwrap(); // Holds this poll open while shutdown starts on another thread. release_rx.recv().unwrap(); - kio::clock::sleep(Duration::from_millis(1)).await; - // Even if the sleep is already due, only the shutdown may finish this call. - std::future::pending::>().await + // Arms a timer on tokio's host driver, which shutdown must not stop under this poll. + // The clock never reaches its last instant, so only the shutdown finishes this call. + kio::clock::sleep_until(kio::clock::now().saturating_add(Duration::MAX)).await; + unreachable!("the clock reached its last instant") }); tokio::runtime::Builder::new_current_thread() .build()