test: updated with timeout on panic rpc listener

This commit is contained in:
2005 2024-10-24 22:16:25 +02:00
parent ee4af91c42
commit e76f5546af

View file

@ -6,7 +6,12 @@ mod test {
use futures::future::join_all; use futures::future::join_all;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use test_log::test; 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 tracing_test::traced_test;
use crate::{ use crate::{
@ -109,8 +114,7 @@ mod test {
) )
.await; .await;
tracing::debug!("Starting listener"); tracing::debug!("Starting listener");
listener.start_all_listeners().await; let out = timeout(Duration::from_secs(5), listener.start_all_listeners()).await;
signal::ctrl_c().await.expect("failed to listen for event");
} }
#[test(tokio::test)] #[test(tokio::test)]