panic when test timeout
This commit is contained in:
@ -1868,7 +1868,20 @@ mod tests {
|
|||||||
*start_progress.read().unwrap(),
|
*start_progress.read().unwrap(),
|
||||||
ValidatorStartProgress::Running
|
ValidatorStartProgress::Running
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// spawn a new thread to wait for validator close
|
||||||
|
let (sender, receiver) = bounded(0);
|
||||||
|
let _ = thread::spawn(move || {
|
||||||
validator.close();
|
validator.close();
|
||||||
|
sender.send(()).unwrap();
|
||||||
|
});
|
||||||
|
|
||||||
|
// timeout of 30s for shutting down the validators
|
||||||
|
let timeout = Duration::from_secs(30);
|
||||||
|
if let Err(RecvTimeoutError::Timeout) = receiver.recv_timeout(timeout) {
|
||||||
|
panic!("timeout for closing validator");
|
||||||
|
}
|
||||||
|
|
||||||
remove_dir_all(validator_ledger_path).unwrap();
|
remove_dir_all(validator_ledger_path).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user