Skip to content

Commit 0015c26

Browse files
committed
bias the select! to ensure that the long sleep is awaited first.
1 parent 48cdd43 commit 0015c26

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tokio/tests/time_sleep.rs

+1
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ async fn issue_5183() {
274274
let big = std::time::Duration::from_secs(u64::MAX / 10);
275275
// This is a workaround since awaiting sleep(big) will never finish.
276276
tokio::select! {
277+
biased;
277278
_ = tokio::time::sleep(big) => {}
278279
_ = tokio::time::sleep(std::time::Duration::from_nanos(1)) => {}
279280
}

0 commit comments

Comments
 (0)