File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff 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) ;
You can’t perform that action at this time.
0 commit comments