aboutsummaryrefslogtreecommitdiff
path: root/tests/time_rt.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/time_rt.rs')
-rw-r--r--tests/time_rt.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/time_rt.rs b/tests/time_rt.rs
index b739f1b..85db78d 100644
--- a/tests/time_rt.rs
+++ b/tests/time_rt.rs
@@ -15,7 +15,7 @@ fn timer_with_threaded_runtime() {
rt.spawn(async move {
let when = Instant::now() + Duration::from_millis(100);
- delay_until(when).await;
+ sleep_until(when).await;
assert!(Instant::now() >= when);
tx.send(()).unwrap();
@@ -28,17 +28,13 @@ fn timer_with_threaded_runtime() {
fn timer_with_basic_scheduler() {
use tokio::runtime::Builder;
- let mut rt = Builder::new()
- .basic_scheduler()
- .enable_all()
- .build()
- .unwrap();
+ let rt = Builder::new_current_thread().enable_all().build().unwrap();
let (tx, rx) = mpsc::channel();
rt.block_on(async move {
let when = Instant::now() + Duration::from_millis(100);
- delay_until(when).await;
+ sleep_until(when).await;
assert!(Instant::now() >= when);
tx.send(()).unwrap();
@@ -72,7 +68,7 @@ async fn starving() {
}
let when = Instant::now() + Duration::from_millis(20);
- let starve = Starve(delay_until(when), 0);
+ let starve = Starve(sleep_until(when), 0);
starve.await;
assert!(Instant::now() >= when);