Skip to content

Commit 8029c8b

Browse files
committed
fixup test
1 parent cecff54 commit 8029c8b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

quinn/src/tests.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,11 @@ async fn on_closed_endpoint_drop() {
10831083
drop(conn);
10841084
drop(server);
10851085
let (cause, _stats) = on_closed.await;
1086-
assert!(matches!(cause, ConnectionError::ApplicationClosed(_)));
1086+
// Depending on timing we might have received a close frame or not.
1087+
assert!(matches!(
1088+
cause,
1089+
ConnectionError::ApplicationClosed(_) | ConnectionError::LocallyClosed
1090+
));
10871091
}),
10881092
);
10891093
let client_task = tokio::time::timeout(
@@ -1099,7 +1103,11 @@ async fn on_closed_endpoint_drop() {
10991103
drop(conn);
11001104
drop(client);
11011105
let (cause, _stats) = on_closed.await;
1102-
assert_eq!(cause, ConnectionError::LocallyClosed);
1106+
// Depending on timing we might have received a close frame or not.
1107+
assert!(matches!(
1108+
cause,
1109+
ConnectionError::ApplicationClosed(_) | ConnectionError::LocallyClosed
1110+
));
11031111
}),
11041112
);
11051113
let (server_res, client_res) = tokio::join!(server_task, client_task);

0 commit comments

Comments
 (0)