diff --git a/tests/async_fd/io.rs b/tests/async_fd/io.rs index 6ea9fb4..be14dca 100644 --- a/tests/async_fd/io.rs +++ b/tests/async_fd/io.rs @@ -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); }