diff options
| author | Ralf Jung <post@ralfj.de> | 2023-05-08 10:20:19 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2023-05-08 10:20:19 +0200 |
| commit | 64d4fd5ab7cae8629a8a574d0097be54ec3eab8f (patch) | |
| tree | ac3674bd6d342b5818598533f908b0c2272c1143 | |
| parent | 1db8540fe62bb76f14a8d54dc6838d3672b0130d (diff) | |
| download | rust-64d4fd5ab7cae8629a8a574d0097be54ec3eab8f.tar.gz rust-64d4fd5ab7cae8629a8a574d0097be54ec3eab8f.zip | |
print how long the measured sleep time actually was on test failure
| -rw-r--r-- | src/tools/miri/tests/pass/concurrency/sync.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tools/miri/tests/pass/concurrency/sync.rs b/src/tools/miri/tests/pass/concurrency/sync.rs index a4d523204bc..28adebd0995 100644 --- a/src/tools/miri/tests/pass/concurrency/sync.rs +++ b/src/tools/miri/tests/pass/concurrency/sync.rs @@ -203,7 +203,8 @@ fn park_timeout() { // know Miri's timed synchronization primitives do not do that. // We allow much longer sleeps as well since the macOS GHA runners seem very oversubscribed // and sometimes just pause for 1 second or more. - assert!((200..2000).contains(&start.elapsed().as_millis())); + let elapsed = start.elapsed(); + assert!((200..2000).contains(&elapsed.as_millis()), "bad sleep time: {:?}", elapsed); } fn park_unpark() { @@ -222,7 +223,8 @@ fn park_unpark() { // know Miri's timed synchronization primitives do not do that. // We allow much longer sleeps as well since the macOS GHA runners seem very oversubscribed // and sometimes just pause for 1 second or more. - assert!((200..2000).contains(&start.elapsed().as_millis())); + let elapsed = start.elapsed(); + assert!((200..2000).contains(&elapsed.as_millis()), "bad sleep time: {:?}", elapsed); t2.join().unwrap(); } |
