This commit is contained in:
Floris Bruynooghe
2024-12-06 15:12:31 +01:00
parent 8a76e2f8cf
commit ff0419b876
3 changed files with 11 additions and 0 deletions

1
Cargo.lock generated
View File

@@ -1405,6 +1405,7 @@ dependencies = [
"tokio-tar",
"tokio-util",
"toml",
"tracing-subscriber",
"url",
"uuid",
"webpki-roots",

View File

@@ -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 = [

View File

@@ -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;