mirror of https://github.com/rwf2/Rocket.git
Use a tokio timer instead of std:🧵:sleep in template reload test.
This commit is contained in:
parent
d1815e527f
commit
76ef92a2e1
|
@ -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
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue