From d1c001e29d3bf6be95356b6a25510f7e89458180 Mon Sep 17 00:00:00 2001 From: Tomasz Pietrek Date: Tue, 9 Apr 2024 14:08:10 +0200 Subject: [PATCH] Fix force_reconnect test Signed-off-by: Tomasz Pietrek --- async-nats/tests/client_tests.rs | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/async-nats/tests/client_tests.rs b/async-nats/tests/client_tests.rs index 6adf763b9..f125e9765 100644 --- a/async-nats/tests/client_tests.rs +++ b/async-nats/tests/client_tests.rs @@ -28,7 +28,6 @@ mod client { async fn force_reconnect() { let (dctx, mut dcrx) = tokio::sync::mpsc::channel(1); let (rctx, mut rcrx) = tokio::sync::mpsc::channel(1); - let (tx, mut rx) = tokio::sync::mpsc::channel(1); let server = nats_server::run_basic_server(); @@ -48,16 +47,6 @@ mod client { .await .unwrap(); - let second_client = async_nats::connect(server.client_url()).await.unwrap(); - // second client to check if we properly flush before forcing reconnect. - let mut sub = second_client.subscribe("test").await.unwrap(); - tokio::task::spawn({ - async move { - sub.next().await.unwrap(); - tx.send(()).await.unwrap(); - } - }); - let mut sub = client.subscribe("foo").await.unwrap(); // make sure message sent just before reconnect is flushed. @@ -81,12 +70,6 @@ mod client { .await .unwrap() .unwrap(); - - // check if message sent just before reconnect is received. - tokio::time::timeout(Duration::from_secs(15), rx.recv()) - .await - .unwrap() - .unwrap(); } #[tokio::test]