Skip to content

Commit c4a5408

Browse files
committed
Make test parallel
Use std::thread::available_parallelism() instead of hardcoded --test-threads=1 in bootstrap tests.
1 parent df2caed commit c4a5408

File tree

1 file changed

+2
-3
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+2
-3
lines changed

src/bootstrap/src/core/build_steps/test.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3294,9 +3294,8 @@ impl Step for Bootstrap {
32943294
.env("INSTA_WORKSPACE_ROOT", &builder.src)
32953295
.env("RUSTC_BOOTSTRAP", "1");
32963296

3297-
// bootstrap tests are racy on directory creation so just run them one at a time.
3298-
// Since there's not many this shouldn't be a problem.
3299-
run_cargo_test(cargo, &["--test-threads=1"], &[], None, host, builder);
3297+
let threads = std::thread::available_parallelism().map(|n| n.get()).unwrap_or(1);
3298+
run_cargo_test(cargo, &["--test-threads", &threads.to_string()], &[], None, host, builder);
33003299
}
33013300

33023301
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {

0 commit comments

Comments
 (0)