Skip to content

Commit 33ea44f

Browse files
Graceful shutdown Hyper connection (#4052)
1 parent 09e0e6d commit 33ea44f

File tree

1 file changed

+5
-2
lines changed
  • crates/example-tests/src

1 file changed

+5
-2
lines changed

crates/example-tests/src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,14 +354,17 @@ pub async fn test_example(
354354
let conn = builder.serve_connection(TokioIo::new(stream), &service);
355355
tokio::pin!(conn);
356356

357-
tokio::select! {
357+
let ret = tokio::select! {
358358
res = conn.as_mut() => {
359359
res.map_err(|e| anyhow::Error::msg(e.to_string()))
360360
}
361361
_ = rx => {
362362
Ok(())
363363
}
364-
}
364+
};
365+
366+
conn.graceful_shutdown();
367+
ret
365368
},
366369
async {
367370
#[derive(Deserialize)]

0 commit comments

Comments
 (0)