Skip to content

Commit 5f7c1d9

Browse files
Merge pull request #2 from nurmohammed840/dev
test: wait for task to drop
2 parents 8b442e6 + c4aedda commit 5f7c1d9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

tests/task_abort.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ async fn test_abort_task_that_panics_on_drop_returned() {
194194
});
195195

196196
// wait for task to sleep.
197-
time::sleep(Duration::from_millis(100)).await;
197+
time::sleep(Duration::from_secs(1)).await;
198198

199199
handle.abort();
200200
assert!(handle.await.unwrap_err().is_panic());

tests/tcp_accept.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ use std::sync::{
4949
Arc,
5050
};
5151
use std::task::{Context, Poll};
52+
use std::time::Duration;
5253
use tokio_stream::{Stream, StreamExt};
5354

5455
struct TrackPolls<'a> {
@@ -86,6 +87,7 @@ async fn no_extra_poll() {
8687

8788
let npolls = assert_ok!(rx.await);
8889
nio::task::yield_now().await;
90+
nio::time::sleep(Duration::from_secs(1)).await;
8991

9092
// should have been polled exactly once: the initial poll
9193
assert_eq!(npolls.load(SeqCst), 1);

0 commit comments

Comments
 (0)