fix: stabilize idle timeout sender tests#172
Conversation
There was a problem hiding this comment.
Pull request overview
Stabilizes the IdleTimeoutSender unit tests by replacing a fixed post-timeout sleep with a polling helper that waits up to a bounded duration for oneshot delivery, reducing CI scheduling flakiness without changing production sender behavior.
Changes:
- Add a
recv_withinhelper that repeatedlytry_recvs until a timeout. - Replace
sleep + try_recvassertions withrecv_within(..., 1s)in the delayed-delivery and “later send supersedes earlier” tests. - Keep the existing immediate
Noneassertion to ensure delayed sends don’t complete before the configured timeout.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CI's `clippy::disallowed_types` lint forbids `std::time::Instant` (it isn't implemented for wasm targets) and requires `instant::Instant`, which the rest of the crate already uses. Swap the import; `Duration` stays from std (it is allowed). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Pushed Heads up on the prior Run Windows tests failure: the only failing test was |
Summary
IdleTimeoutSendertests by polling for delayed oneshot delivery instead of relying on a fixed post-timeout sleep.Noneassertion so the tests still verify that delayed sends do not complete before the timeout.Root Cause
The macOS 26 scheduled CI runner failed
idle_timeout_sender_later_send_after_supersedes_earlierbecause the test slept for 100ms after scheduling a 50ms timer and assumed the spawned timer thread had also been scheduled and delivered by then. Under CI load, the receiver was still empty, producingleft: None,right: Some(2).Verification
cargo nextest run -p warp-app idle_timeout_sender --features gui --profile defaultcargo fmt --check./script/check_ai_attribution./script/check_rebrandcargo check -p warp-app --bin cast-codes --features gui