diff --git a/contrib/lib/Cargo.toml b/contrib/lib/Cargo.toml index 4ccf8806..40ef57aa 100644 --- a/contrib/lib/Cargo.toml +++ b/contrib/lib/Cargo.toml @@ -86,5 +86,8 @@ time = { version = "0.2.9", optional = true } brotli = { version = "3.3", optional = true } flate2 = { version = "1.0", optional = true } +[dev-dependencies] +tokio-timer = "=0.3.0-alpha.5" + [package.metadata.docs.rs] all-features = true diff --git a/contrib/lib/tests/templates.rs b/contrib/lib/tests/templates.rs index d9f56ac8..7250ab9c 100644 --- a/contrib/lib/tests/templates.rs +++ b/contrib/lib/tests/templates.rs @@ -124,7 +124,6 @@ mod templates_tests { async fn test_template_reload() { use std::fs::File; use std::io::Write; - use std::thread; use std::time::Duration; use rocket::local::Client; @@ -169,9 +168,8 @@ mod templates_tests { return; } - // TODO.async: blocking call in async context // otherwise, retry a few times, waiting 250ms in between - thread::sleep(Duration::from_millis(250)); + tokio_timer::delay_for(Duration::from_millis(250)).await; } panic!("failed to reload modified template in 1.5s");