diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-10-29 15:03:53 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-29 15:03:53 -0500 |
commit | 79407f3690f8488ec07fc310e885cba5b4e03162 (patch) | |
tree | 6acf8427b05e3b5b4c80dc3ccb7a6d2d6d0c1c1f | |
parent | 64e9a993534d2eca3609f339d24e8f140ddaff5e (diff) | |
parent | c82cb6d9df1ff44ab05b18a062f849a9026bb4ec (diff) |
Auto merge of #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.
-rw-r--r-- | tests/tests.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/tests.rs b/tests/tests.rs index 66e70859..1f8864e0 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -85,16 +85,15 @@ fn run_bindgen_tests() { } }); - // First spawn all child processes and collect them, then wait on each - // one. This runs the tests in parallel rather than serially. + // Spawn one child at a time and wait on it as number of process + // is the number of test files. - let children: Vec<_> = tests.map(|entry| { - let child = spawn_run_bindgen(run_bindgen.clone(), bindgen.clone(), entry.path()); - (entry.path(), child) - }) - .collect(); + let children = tests.map(|entry| { + let child = spawn_run_bindgen(run_bindgen.clone(), bindgen.clone(), entry.path()); + (entry.path(), child) + }); - let failures: Vec<_> = children.into_iter() + let failures: Vec<_> = children .filter_map(|(path, mut child)| { let passed = child.wait() .expect("Should wait on child process") |