From ccc1fb387297f1bd0d83f6346d95ade6cc1590c9 Mon Sep 17 00:00:00 2001 From: Transaction Science Date: Wed, 21 Oct 2026 07:39:04 -0400 Subject: [PATCH] joule-moq-relay test: the client closes after the relay holds its session The relay sends its SETUP first and reads the client's after it; a client that closed the moment it had the relay's SETUP could close before the relay read its own, a session never served, with no summary. Under load (CI) that race lost the summary about one run in five. Co-Authored-By: Claude Opus 5.5 --- .../crates/joule-moq-relay/tests/webtransport_close.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/joule-code/joule-code-rs/crates/joule-moq-relay/tests/webtransport_close.rs b/joule-code/joule-code-rs/crates/joule-moq-relay/tests/webtransport_close.rs index 6691e4600..c0446ddf7 100644 --- a/joule-code/joule-code-rs/crates/joule-moq-relay/tests/webtransport_close.rs +++ b/joule-code/joule-code-rs/crates/joule-moq-relay/tests/webtransport_close.rs @@ -88,6 +88,10 @@ async fn run() { // A client closes its session with a code of its own: the relay reads it as the peer's, // and its summary records it; the client's own end reads its close as local. let (c, _) = connect(&rooms, Via::WebTransport, ClientOptions::default()).await; + // The client has its handshake once the relay's SETUP arrives; the relay reads the + // client's SETUP after sending its own, and a session closed before then was never served + // and gets no summary. So the close waits until the relay holds the session. + assert!(until(STEP, || rooms.relay().session_diagnostics().len() == 1).await, "the relay holds the session"); c.close(SessionError::PROTOCOL_VIOLATION.0, "a client's own close"); assert_eq!( closed(c.conn.as_ref(), "the client's close").await, -- 2.54.0 (Apple Git-157)