Skip to content

Commit 23ab59e

Browse files
authored
fix: Change MTU test setup so it isn't slow (#2828)
1 parent afb6ecf commit 23ab59e

File tree

1 file changed

+25
-2
lines changed
  • quic/s2n-quic-tests/src/tests

1 file changed

+25
-2
lines changed

quic/s2n-quic-tests/src/tests/mtu.rs

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,31 @@ fn mtu_updates<S: tls::Provider, C: tls::Provider>(
9898
.with_tls(client)?
9999
.start()?;
100100
let addr = start_server(server)?;
101-
// we need a large payload to allow for multiple rounds of MTU probing
102-
start_client(client, addr, Data::new(70_000_000))?;
101+
102+
primary::spawn(async move {
103+
let connect = Connect::new(addr).with_server_name("localhost");
104+
let mut connection = client.connect(connect).await.unwrap();
105+
106+
tracing::debug!("connected with client connection: {}", connection.id());
107+
108+
let stream = connection.open_bidirectional_stream().await.unwrap();
109+
tracing::debug!("opened client stream: {}", stream.id());
110+
111+
let (mut recv, mut send) = stream.split();
112+
113+
// 50 roundtrips is enough for MTU probing completion
114+
primary::spawn(async move {
115+
for _ in 0..50 {
116+
tracing::debug!("client sending ping");
117+
send.send("ping".into()).await.unwrap();
118+
if let Some(chunk) = recv.receive().await.unwrap() {
119+
assert!(chunk == "ping");
120+
tracing::debug!("received ping from server");
121+
}
122+
}
123+
});
124+
});
125+
103126
Ok(addr)
104127
})
105128
.unwrap();

0 commit comments

Comments
 (0)