Skip to content
This repository has been archived by the owner on Nov 28, 2020. It is now read-only.

Commit

Permalink
Make client test fail faster on race condition (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-airoldie authored May 28, 2019
1 parent d1e4ca4 commit 9f357eb
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions libzmq/src/auth/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ mod test {
let client =
ClientBuilder::new().connect(bound).with_ctx(&ctx).unwrap();

client.send("").unwrap();
client.try_send("").unwrap();
assert!(server.recv_msg().is_err());
}

Expand All @@ -552,7 +552,7 @@ mod test {
let client =
ClientBuilder::new().connect(bound).with_ctx(&ctx).unwrap();

client.send("").unwrap();
client.try_send("").unwrap();
server.recv_msg().unwrap();
}

Expand All @@ -569,7 +569,8 @@ mod test {
let client = Client::new().unwrap();

client.connect(bound).unwrap();
client.send("").unwrap();

client.try_send("").unwrap();
server.recv_msg().unwrap();
}

Expand All @@ -592,7 +593,7 @@ mod test {
client.set_mechanism(Mechanism::PlainClient(creds)).unwrap();
client.connect(bound).unwrap();

client.send("").unwrap();
client.try_send("").unwrap();
assert!(server.recv_msg().is_err());
}

Expand Down Expand Up @@ -623,7 +624,7 @@ mod test {
.with_ctx(&ctx)
.unwrap();

client.send("").unwrap();
client.try_send("").unwrap();
server.recv_msg().unwrap();
}

Expand Down Expand Up @@ -663,7 +664,7 @@ mod test {
.with_ctx(&ctx)
.unwrap();

client.send("").unwrap();
client.try_send("").unwrap();
server.recv_msg().unwrap();
}

Expand Down Expand Up @@ -691,7 +692,7 @@ mod test {
.build()
.unwrap();

client.send("").unwrap();
client.try_send("").unwrap();
assert!(server.recv_msg().is_err());
}

Expand Down Expand Up @@ -721,7 +722,7 @@ mod test {
client.set_mechanism(client_creds).unwrap();
client.connect(bound).unwrap();

client.send("").unwrap();
client.try_send("").unwrap();
server.recv_msg().unwrap();
}
}

0 comments on commit 9f357eb

Please sign in to comment.