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,