From ff0419b87676c3ff5535d756adf7f9cf389eed2a Mon Sep 17 00:00:00 2001 From: Floris Bruynooghe Date: Fri, 6 Dec 2024 15:12:31 +0100 Subject: [PATCH] some wip --- Cargo.lock | 1 + Cargo.toml | 1 + src/peer_channels.rs | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index deadf4f76..9cfda32ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1405,6 +1405,7 @@ dependencies = [ "tokio-tar", "tokio-util", "toml", + "tracing-subscriber", "url", "uuid", "webpki-roots", diff --git a/Cargo.toml b/Cargo.toml index 0bd8cb562..de642a6b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -123,6 +123,7 @@ proptest = { version = "1", default-features = false, features = ["std"] } tempfile = { workspace = true } testdir = "0.9.0" tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } +tracing-subscriber.workspace = true [workspace] members = [ diff --git a/src/peer_channels.rs b/src/peer_channels.rs index c073b60b4..3397dd950 100644 --- a/src/peer_channels.rs +++ b/src/peer_channels.rs @@ -563,6 +563,8 @@ async fn subscribe_loop( #[cfg(test)] mod tests { + use std::time::Duration; + use super::*; use crate::{ chat::send_msg, @@ -741,6 +743,13 @@ mod tests { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn test_can_reconnect() { + tokio::time::timeout(Duration::from_secs(20), test_can_reconnect_impl()) + .await + .unwrap(); + } + + async fn test_can_reconnect_impl() { + tracing_subscriber::fmt::init(); let mut tcm = TestContextManager::new(); let alice = &mut tcm.alice().await; let bob = &mut tcm.bob().await;