Fix a test child process panic bug (#5842)

This commit is contained in:
teor 2022-12-13 09:19:30 +10:00 committed by GitHub
parent 75f2f02ef7
commit 47073ab30a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -846,8 +846,10 @@ impl<T> TestChild<T> {
self.kill(true)?;
}
let timeout =
humantime::format_duration(self.timeout.expect("already checked past_deadline()"));
let timeout = self
.timeout
.map(|timeout| humantime::format_duration(timeout).to_string())
.unwrap_or_else(|| "unlimited".to_string());
let report = eyre!(
"{stream_name} of command did not log any matches for the given regex,\n\