Expect errors when opening 2nd stream due to connection limit (#31706)
This commit is contained in:
parent
e6d490708a
commit
a8e2b82e38
|
@ -1232,7 +1232,16 @@ pub mod test {
|
||||||
let conn1 = make_client_endpoint(&server_address, None).await;
|
let conn1 = make_client_endpoint(&server_address, None).await;
|
||||||
let conn2 = make_client_endpoint(&server_address, None).await;
|
let conn2 = make_client_endpoint(&server_address, None).await;
|
||||||
let mut s1 = conn1.open_uni().await.unwrap();
|
let mut s1 = conn1.open_uni().await.unwrap();
|
||||||
let mut s2 = conn2.open_uni().await.unwrap();
|
let s2 = conn2.open_uni().await;
|
||||||
|
if s2.is_err() {
|
||||||
|
// It has been noticed if there is already connection open against the server, this open_uni can fail
|
||||||
|
// with ApplicationClosed(ApplicationClose) error due to CONNECTION_CLOSE_CODE_TOO_MANY before writing to
|
||||||
|
// the stream -- expect it.
|
||||||
|
let s2 = s2.err().unwrap();
|
||||||
|
assert!(matches!(s2, quinn::ConnectionError::ApplicationClosed(_)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let mut s2 = s2.unwrap();
|
||||||
s1.write_all(&[0u8]).await.unwrap();
|
s1.write_all(&[0u8]).await.unwrap();
|
||||||
s1.finish().await.unwrap();
|
s1.finish().await.unwrap();
|
||||||
// Send enough data to create more than 1 chunks.
|
// Send enough data to create more than 1 chunks.
|
||||||
|
|
Loading…
Reference in New Issue