Skip to content

Commit 79407f3

Browse files
author
bors-servo
authored
Auto merge of rust-lang#159 - jeanphilippeD:serial_tests, r=emilio
Run test in serial by default to not take all memory When running all the test in parallel, all the memory on my laptop is consumed by rustc processes, my machine become unusable and the tests do not make progress. It seems to make sense to have serial by default, as the number of process depends on the number of test files. To run the test in parallel: RUN_TEST_PARALLEL=1 cargo test --feature llvm_stable This is a first approach at this issue, I'm still really new to rust. I was trying to run the test for an easy fix, but it was killing my machine. Ideally it would have been nice to be able to control exactly how many process to run in parallel, maybe using chunks somewhere. I could try to see if I can work it out if it would be a better solution.
2 parents 64e9a99 + c82cb6d commit 79407f3

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

tests/tests.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,15 @@ fn run_bindgen_tests() {
8585
}
8686
});
8787

88-
// First spawn all child processes and collect them, then wait on each
89-
// one. This runs the tests in parallel rather than serially.
88+
// Spawn one child at a time and wait on it as number of process
89+
// is the number of test files.
9090

91-
let children: Vec<_> = tests.map(|entry| {
92-
let child = spawn_run_bindgen(run_bindgen.clone(), bindgen.clone(), entry.path());
93-
(entry.path(), child)
94-
})
95-
.collect();
91+
let children = tests.map(|entry| {
92+
let child = spawn_run_bindgen(run_bindgen.clone(), bindgen.clone(), entry.path());
93+
(entry.path(), child)
94+
});
9695

97-
let failures: Vec<_> = children.into_iter()
96+
let failures: Vec<_> = children
9897
.filter_map(|(path, mut child)| {
9998
let passed = child.wait()
10099
.expect("Should wait on child process")

0 commit comments

Comments
 (0)