Add test timeout.

This commit is contained in:
Samuel Guerra 2024-04-05 15:51:09 -03:00
parent 6cd0e2c867
commit c3a250eac2
2 changed files with 11 additions and 1 deletions

View File

@ -245,9 +245,19 @@ fn concurrent_read_write() {
})
.collect();
static DONE: std::sync::Once = std::sync::Once::new();
std::thread::spawn(|| {
std::thread::sleep(240.secs());
if !DONE.is_completed() {
panic!("timeout aftet 240s");
}
});
for t in threads {
t.join().unwrap();
}
DONE.call_once(|| {});
}
#[test]

View File

@ -1327,7 +1327,7 @@ mod response {
});
let ab = app
.run_task(async { task::with_deadline(ab.wait_into_rsp(), 20.secs()).await })
.run_task(async { task::with_deadline(ab.wait_into_rsp(), 40.secs()).await })
.unwrap()
.unwrap();