Skip to content

Commit

Permalink
Fix async reconnect test
Browse files Browse the repository at this point in the history
  • Loading branch information
rageshkrishna committed Mar 19, 2024
1 parent b2073c9 commit afb2e91
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions socketio/src/asynchronous/client/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ mod test {
asynchronous::client::{builder::ClientBuilder, client::Client},
error::Result,
packet::{Packet, PacketId},
Event, Payload, TransportType,
Payload, TransportType,
};

#[tokio::test]
Expand Down Expand Up @@ -735,7 +735,7 @@ mod test {
let socket = socket.unwrap();

// waiting for server to emit message
std::thread::sleep(std::time::Duration::from_millis(500));
sleep(Duration::from_millis(500)).await;

assert_eq!(load(&CONNECT_NUM), 1, "should connect once");
assert_eq!(load(&MESSAGE_NUM), 1, "should receive one");
Expand All @@ -745,7 +745,7 @@ mod test {

// waiting for server to restart
for _ in 0..10 {
std::thread::sleep(std::time::Duration::from_millis(400));
sleep(Duration::from_millis(400)).await;
if load(&CONNECT_NUM) == 2 && load(&MESSAGE_NUM) == 2 {
break;
}
Expand Down

0 comments on commit afb2e91

Please sign in to comment.