Skip to content

Commit 64d4fd5

Browse files
committed
print how long the measured sleep time actually was on test failure
1 parent 1db8540 commit 64d4fd5

File tree

1 file changed

+4
-2
lines changed
  • src/tools/miri/tests/pass/concurrency

1 file changed

+4
-2
lines changed

src/tools/miri/tests/pass/concurrency/sync.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ fn park_timeout() {
203203
// know Miri's timed synchronization primitives do not do that.
204204
// We allow much longer sleeps as well since the macOS GHA runners seem very oversubscribed
205205
// and sometimes just pause for 1 second or more.
206-
assert!((200..2000).contains(&start.elapsed().as_millis()));
206+
let elapsed = start.elapsed();
207+
assert!((200..2000).contains(&elapsed.as_millis()), "bad sleep time: {:?}", elapsed);
207208
}
208209

209210
fn park_unpark() {
@@ -222,7 +223,8 @@ fn park_unpark() {
222223
// know Miri's timed synchronization primitives do not do that.
223224
// We allow much longer sleeps as well since the macOS GHA runners seem very oversubscribed
224225
// and sometimes just pause for 1 second or more.
225-
assert!((200..2000).contains(&start.elapsed().as_millis()));
226+
let elapsed = start.elapsed();
227+
assert!((200..2000).contains(&elapsed.as_millis()), "bad sleep time: {:?}", elapsed);
226228

227229
t2.join().unwrap();
228230
}

0 commit comments

Comments
 (0)