Skip to content

Commit

Permalink
Fix force_reconnect test
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Pietrek <[email protected]>
  • Loading branch information
Jarema committed Apr 9, 2024
1 parent 9a81257 commit d1c001e
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions async-nats/tests/client_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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.
Expand All @@ -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]
Expand Down

0 comments on commit d1c001e

Please sign in to comment.