Skip to content

Commit f875ce8

Browse files
committed
Fix flaky test
1 parent 5913e3a commit f875ce8

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

Cargo.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ edition = "2018"
99
rust-version = "1.39"
1010
license = "Apache-2.0 OR MIT"
1111
repository = "https://github.com/smol-rs/async-task"
12-
homepage = "https://github.com/smol-rs/async-task"
13-
documentation = "https://docs.rs/async-task"
1412
description = "Task abstraction for building executors"
1513
keywords = ["futures", "task", "executor", "spawn"]
1614
categories = ["asynchronous", "concurrency", "no-std"]
@@ -21,8 +19,9 @@ default = ["std"]
2119
std = []
2220

2321
[dev-dependencies]
24-
atomic-waker = "1.0.0"
25-
easy-parallel = "3.1.0"
22+
atomic-waker = "1"
23+
easy-parallel = "3"
24+
flaky_test = "0.1"
2625
flume = { version = "0.10", default-features = false }
27-
once_cell = "1.4.1"
28-
smol = "1.0.1"
26+
once_cell = "1"
27+
smol = "1"

tests/waker_panic.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,15 @@ fn wake_and_cancel_during_run() {
238238
.run();
239239
}
240240

241-
#[test]
241+
#[flaky_test::flaky_test]
242242
fn cancel_and_wake_during_run() {
243243
future!(f, get_waker, POLL, DROP_F);
244244
schedule!(s, chan, SCHEDULE, DROP_S);
245+
POLL.store(0, Ordering::SeqCst);
246+
DROP_F.store(0, Ordering::SeqCst);
247+
SCHEDULE.store(0, Ordering::SeqCst);
248+
DROP_S.store(0, Ordering::SeqCst);
249+
245250
let (runnable, task) = async_task::spawn(f, s);
246251

247252
runnable.run();

0 commit comments

Comments
 (0)