From 605e68dff6e0780e2059d752b33ae1847282ce55 Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Fri, 6 Apr 2018 10:49:17 -0700 Subject: [PATCH] Add pretty durations to panics from `assert_eventually!` (#677) This PR adds the pretty-printing for durations I added in #676 to the panic message from the `assert_eventually!` macro added in #669. Signed-off-by: Eliza Weisman --- proxy/tests/support/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/proxy/tests/support/mod.rs b/proxy/tests/support/mod.rs index 9d232d70e..169494173 100644 --- a/proxy/tests/support/mod.rs +++ b/proxy/tests/support/mod.rs @@ -75,8 +75,10 @@ macro_rules! assert_eventually { break; } else if i == $retries { panic!( - "assertion failed after {:?} (retried {} times): {}", - start_t.elapsed(), i, format_args!($($arg)+) + "assertion failed after {} (retried {} times): {}", + timeout::HumanDuration(start_t.elapsed()), + i, + format_args!($($arg)+) ) } else { ::std::thread::sleep(patience);