From e76f5546afbd668f94090efc2d3aa5bb2648651a Mon Sep 17 00:00:00 2001 From: 4o1x5 <4o1x5@4o1x5.dev> Date: Thu, 24 Oct 2024 22:16:25 +0200 Subject: [PATCH] test: updated with timeout on panic rpc listener --- src/test/mod.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/test/mod.rs b/src/test/mod.rs index 00af14e..8bc7d5f 100644 --- a/src/test/mod.rs +++ b/src/test/mod.rs @@ -6,7 +6,12 @@ mod test { use futures::future::join_all; use serde::{Deserialize, Serialize}; use test_log::test; - use tokio::{runtime::Builder, signal, sync::Mutex, time::sleep}; + use tokio::{ + runtime::Builder, + signal, + sync::Mutex, + time::{sleep, timeout}, + }; use tracing_test::traced_test; use crate::{ @@ -109,8 +114,7 @@ mod test { ) .await; tracing::debug!("Starting listener"); - listener.start_all_listeners().await; - signal::ctrl_c().await.expect("failed to listen for event"); + let out = timeout(Duration::from_secs(5), listener.start_all_listeners()).await; } #[test(tokio::test)]