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 <eliza@buoyant.io>
This commit is contained in:
Eliza Weisman 2018-04-06 10:49:17 -07:00 committed by GitHub
parent c31f4ba993
commit 605e68dff6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -75,8 +75,10 @@ macro_rules! assert_eventually {
break; break;
} else if i == $retries { } else if i == $retries {
panic!( panic!(
"assertion failed after {:?} (retried {} times): {}", "assertion failed after {} (retried {} times): {}",
start_t.elapsed(), i, format_args!($($arg)+) timeout::HumanDuration(start_t.elapsed()),
i,
format_args!($($arg)+)
) )
} else { } else {
::std::thread::sleep(patience); ::std::thread::sleep(patience);