From 6af626b7006b8eca3790da896a64650d95a26889 Mon Sep 17 00:00:00 2001 From: Transaction Science Date: Fri, 30 Oct 2026 08:45:29 -0400 Subject: [PATCH] joule-moq-ingest: the SRT test's burst of losses mid-stream, not where the publisher closes an_srt_publisher_reaches_a_relay_subscriber_with_every_receipt failed on main (afd1c246): the last part ended the session as idle (2), not by the publisher's shutdown (1). The proxy's losses are a function of the datagram's index, from a seeded generator, plus a burst of six fixed indices toward the gateway, 200 to 205. The publisher closes after 211 to 215 datagrams (20 runs on Linux, instrumented) and sends its three SHUTDOWNs back to back. Past index 190, the burst is the only run of three consecutive losses. A host that sends a few datagrams fewer before the close puts all three SHUTDOWNs in it, and the gateway ends the session by its 5 s idle timeout. The failing run took about 10 s, the close plus that timeout. The burst is now at 100 to 105, mid-stream among the data. With it there, no three consecutive indices from 106 to 399 are lost, so a SHUTDOWN reaches the gateway wherever the close falls. 19 datagrams are still lost before index 211, and the test still finds and counts the first sends of data the path lost. Co-Authored-By: Claude Opus 5.5 --- .../crates/joule-moq-ingest/tests/contrib_srt.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/joule-code/joule-code-rs/crates/joule-moq-ingest/tests/contrib_srt.rs b/joule-code/joule-code-rs/crates/joule-moq-ingest/tests/contrib_srt.rs index 8ee5ac745..c00b390af 100644 --- a/joule-code/joule-code-rs/crates/joule-moq-ingest/tests/contrib_srt.rs +++ b/joule-code/joule-code-rs/crates/joule-moq-ingest/tests/contrib_srt.rs @@ -101,8 +101,11 @@ async fn run() { let s = open_srt(&w, &auth).await; let sid = s["stream_id"].as_str().unwrap(); assert!(sid.starts_with(&format!("#!::r={}/{},m=publish,s=", hex::encode(w.room), w.owner())), "{sid}"); - // 3% of the datagrams dropped each way, and a burst of six toward the gateway. - let up = Impair { loss_ppm: 30_000, drop_index: &[200, 201, 202, 203, 204, 205], ..Impair::default() }; + // 3% of the datagrams dropped each way, and a burst of six toward the gateway, mid-stream. + // The publisher closes after about 211 datagrams and sends its three SHUTDOWNs back to + // back; a burst at 200 swallowed all three when a host sent a few fewer before the close, + // and the gateway ended the session by its idle timeout. + let up = Impair { loss_ppm: 30_000, drop_index: &[100, 101, 102, 103, 104, 105], ..Impair::default() }; let px = Proxy::start(w.gateway.srt_addr.unwrap(), up, Impair { loss_ppm: 30_000, ..Impair::default() }, 0xabc).await.unwrap(); let link = timeout(STEP, srt::call(px.addr, call_cfg(&s))).await.unwrap().expect("the call is admitted"); assert_eq!(link.info.cipher_bits, 128); -- 2.54.0 (Apple Git-157)