Add test timeout.
This commit is contained in:
parent
6cd0e2c867
commit
c3a250eac2
|
@ -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]
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue