From f317fc420052505a4c5ddd95f142d8c496a7b280 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 17 Oct 2026 07:53:24 -0700 Subject: [PATCH] test(net): wait out the jittered retry after a reset renewal a_reset_renewal_ends_only_its_request waited for the re-advertisement with poll_until, which gives up after 100 one-millisecond settles. That advertisement rides the retry, armed at jitter(RETRY_BASE), 50 to 100 ms after the reset, and a millisecond or two of the budget is already spent by then, so a jitter near the top of its window failed the test (about 1 in 50). Assert the reset request was withdrawn, sleep RETRY_BASE on the simulated clock, then look for the fresh advertisement. Co-Authored-By: Claude Opus 5.5 --- rs/moq-net/src/ietf/publisher.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rs/moq-net/src/ietf/publisher.rs b/rs/moq-net/src/ietf/publisher.rs index f86cfcb4e6e..4b293a3b668 100644 --- a/rs/moq-net/src/ietf/publisher.rs +++ b/rs/moq-net/src/ietf/publisher.rs @@ -13632,6 +13632,13 @@ mod tests { poll_until(&mut run, &log, b"first", 1).await; cam.update(crate::origin::Route::default().with_auth(present(b"second"))) .unwrap(); + poll_until(&mut run, &log, b"second", 1).await; + assert!(futures::poll!(run.as_mut()).is_pending()); + assert_eq!(log.resets().len(), 1, "the reset request was not withdrawn"); + + // The advertisement comes back on the retry, jittered up to RETRY_BASE, which + // outlasts poll_until. + moq_clock::sleep(RETRY_BASE).await; poll_until(&mut run, &log, b"second", 2).await; assert_eq!( occurrences(&log, b"second"),