Skip to content

Commit 2db449f

Browse files
authored
Rollup merge of rust-lang#123548 - RalfJung:what-is-time, r=joboet
libtest: also measure time in Miri A long time ago we disabled timekeeping of the default test harness in Miri, as otherwise it would fail to run without `-Zmiri-disable-isolation`. However, since then Miri gained a "fake clock" that lets it present some deterministic notion of time when isolation is enabled. So we could now let libtest do timekeeping again when running in Miri. That's nice as it can help detect tests that run too long. However it can also be confusing as the results with isolation can be quite different than the real time. ``@rust-lang/miri`` what do you think?
2 parents 443a6fb + f83d4d8 commit 2db449f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

test/src/console.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,8 @@ pub fn run_tests_console(opts: &TestOpts, tests: Vec<TestDescAndFn>) -> io::Resu
315315

316316
// Prevent the usage of `Instant` in some cases:
317317
// - It's currently not supported for wasm targets.
318-
// - We disable it for miri because it's not available when isolation is enabled.
319-
let is_instant_unsupported = (cfg!(target_family = "wasm") && !cfg!(target_os = "wasi"))
320-
|| cfg!(target_os = "zkvm")
321-
|| cfg!(miri);
318+
let is_instant_unsupported =
319+
(cfg!(target_family = "wasm") && !cfg!(target_os = "wasi")) || cfg!(target_os = "zkvm");
322320

323321
let start_time = (!is_instant_unsupported).then(Instant::now);
324322
run_tests(opts, tests, |x| on_test_event(&x, &mut st, &mut *out))?;

0 commit comments

Comments
 (0)