improve error message in non_blocking_logger test (#8276)

This commit is contained in:
Arya 2024-02-15 17:46:04 -05:00 committed by GitHub
parent 85a7cc977a
commit f20834c373
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 5 deletions

View File

@ -1691,13 +1691,11 @@ fn non_blocking_logger() -> Result<()> {
Ok(())
});
// Wait until the spawned task finishes or return an error in 45 seconds
if done_rx.recv_timeout(Duration::from_secs(45)).is_err() {
return Err(eyre!("unexpected test task hang"));
// Wait until the spawned task finishes up to 45 seconds before shutting down tokio runtime
if done_rx.recv_timeout(Duration::from_secs(45)).is_ok() {
rt.shutdown_timeout(Duration::from_secs(3));
}
rt.shutdown_timeout(Duration::from_secs(3));
match test_task_handle.now_or_never() {
Some(Ok(result)) => result,
Some(Err(error)) => Err(eyre!("join error: {:?}", error)),