mirror of https://github.com/fafhrd91/actix-web
Merge branch 'master' into clippy-fixes
This commit is contained in:
commit
d1efe02e92
|
@ -5,8 +5,8 @@
|
||||||
routes defined with trailing slashes will become inaccessible when
|
routes defined with trailing slashes will become inaccessible when
|
||||||
using `NormalizePath::default()`.
|
using `NormalizePath::default()`.
|
||||||
|
|
||||||
Before: `#[get("/test/")`
|
Before: `#[get("/test/")]`
|
||||||
After: `#[get("/test")`
|
After: `#[get("/test")]`
|
||||||
|
|
||||||
Alternatively, explicitly require trailing slashes: `NormalizePath::new(TrailingSlash::Always)`.
|
Alternatively, explicitly require trailing slashes: `NormalizePath::new(TrailingSlash::Always)`.
|
||||||
|
|
||||||
|
|
|
@ -326,7 +326,7 @@ mod notify_on_drop {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
use actix_rt::task::yield_now;
|
use actix_rt::{task::yield_now, time::sleep};
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn test_date_service_update() {
|
async fn test_date_service_update() {
|
||||||
|
@ -350,7 +350,14 @@ mod tests {
|
||||||
assert_ne!(buf1, buf2);
|
assert_ne!(buf1, buf2);
|
||||||
|
|
||||||
drop(settings);
|
drop(settings);
|
||||||
assert!(notify_on_drop::is_dropped());
|
|
||||||
|
// Ensure the task will drop eventually
|
||||||
|
let mut times = 0;
|
||||||
|
while !notify_on_drop::is_dropped() {
|
||||||
|
sleep(Duration::from_millis(100)).await;
|
||||||
|
times += 1;
|
||||||
|
assert!(times < 10, "Timeout waiting for task drop");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
|
@ -372,7 +379,14 @@ mod tests {
|
||||||
assert!(!notify_on_drop::is_dropped());
|
assert!(!notify_on_drop::is_dropped());
|
||||||
|
|
||||||
drop(service);
|
drop(service);
|
||||||
assert!(notify_on_drop::is_dropped());
|
|
||||||
|
// Ensure the task will drop eventually
|
||||||
|
let mut times = 0;
|
||||||
|
while !notify_on_drop::is_dropped() {
|
||||||
|
sleep(Duration::from_millis(100)).await;
|
||||||
|
times += 1;
|
||||||
|
assert!(times < 10, "Timeout waiting for task drop");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Reference in New Issue