From 47073ab30a6cccb5dbc2af4260ade916ecec9813 Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 13 Dec 2022 09:19:30 +1000 Subject: [PATCH] Fix a test child process panic bug (#5842) --- zebra-test/src/command.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zebra-test/src/command.rs b/zebra-test/src/command.rs index 182a79645..9549dff08 100644 --- a/zebra-test/src/command.rs +++ b/zebra-test/src/command.rs @@ -846,8 +846,10 @@ impl TestChild { 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\