From 00d376ac9a158abf02718a2c8720e276ce071de8 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Wed, 28 Oct 2026 00:36:23 -0700 Subject: [PATCH] test(net): acknowledge upstream FINs on arrival in relay_upstream_close Co-Authored-By: Claude Opus 5.5 --- .../tests/integration/relay_upstream_close.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/rs/moq-net/tests/integration/relay_upstream_close.rs b/rs/moq-net/tests/integration/relay_upstream_close.rs index 4c9eb212682..b91004d3ffa 100644 --- a/rs/moq-net/tests/integration/relay_upstream_close.rs +++ b/rs/moq-net/tests/integration/relay_upstream_close.rs @@ -9,7 +9,9 @@ //! //! Deterministic: simulated time over the mock transport. The relay's group streams to //! the subscriber are held, with a one-message stream buffer, so the relay still holds -//! most of each track when the upstream session ends. +//! most of each track when the upstream session ends. The publisher's FINs are +//! acknowledged on arrival, as QUIC does, so its close can drain before the relay reads +//! them. use crate::support; @@ -134,6 +136,7 @@ async fn round(name: &str, end: End) -> Vec { .expect("no subscriber appeared"); } + upstream.server_transport.ack_fins(); // The subscriber now reads nothing until the upstream session is gone. downstream.server_transport.hold_unis(); for track in &tracks { @@ -177,10 +180,10 @@ async fn round(name: &str, end: End) -> Vec { outcomes } -/// Every frame of every track, then a clean end. Lite03 and Lite04 declare no end, so the -/// relay is still waiting out its tail grace when the session goes, and on a close each -/// track's SUBSCRIBE FIN is its only end: the transport acknowledges it, which lets the -/// close drain, before the relay has read it. +/// Every frame of every track, then a clean end. On a close the transport acknowledges each +/// track's SUBSCRIBE FIN, which lets the close drain, before the relay has read it, so the +/// relay must still read it from the closed session. Lite03 and Lite04 declare no end, so +/// there the relay is still waiting out its tail grace and the FIN is the track's only end. #[moq_clock::test] async fn relay_delivers_finished_tracks_after_upstream_closes() { let want: Vec<(u64, u64)> = (0..GROUPS)