From 212c781caa6ad3c71d646d3446692388db72aa1e Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Fri, 29 Nov 2024 16:42:23 +0100 Subject: [PATCH] test: add minimal shutdown test --- iroh/src/protocol.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/iroh/src/protocol.rs b/iroh/src/protocol.rs index 89d599d3326..3c9b3d0c310 100644 --- a/iroh/src/protocol.rs +++ b/iroh/src/protocol.rs @@ -376,3 +376,24 @@ async fn handle_connection(incoming: crate::endpoint::Incoming, protocols: Arc

Result<()> { + let endpoint = Endpoint::builder().bind().await?; + let router = Router::builder(endpoint.clone()).spawn().await?; + + assert!(!router.is_shutdown()); + assert!(!endpoint.is_closed()); + + router.shutdown().await?; + + assert!(router.is_shutdown()); + assert!(endpoint.is_closed()); + + Ok(()) + } +}