Skip to content

Commit

Permalink
Deflaky cancel_all_twice_accept
Browse files Browse the repository at this point in the history
Sometime the accept operation was started, which means we get 1,
other time the operation hasn't start yet, which means we get 0.
  • Loading branch information
Thomasdezeeuw committed Apr 27, 2024
1 parent 9dd1f77 commit b4183dd
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/async_fd/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -763,11 +763,9 @@ fn cancel_all_twice_accept() {
let n = waker
.block_on(listener.cancel_all())
.expect("failed to cancel all calls");
assert_eq!(n, 1);
let n = waker
.block_on(listener.cancel_all())
.expect("failed to cancel all calls");
assert_eq!(n, 0);
// Because the the accept call is asynchronous we can cancel up to one
// operations.
assert!(n <= 1);

expect_io_errno(waker.block_on(accept), libc::ECANCELED);
}
Expand Down

0 comments on commit b4183dd

Please sign in to comment.