From c82cb6d9df1ff44ab05b18a062f849a9026bb4ec Mon Sep 17 00:00:00 2001 From: Jean-Philippe DUFRAIGNE Date: Sat, 29 Oct 2016 20:36:19 +0100 Subject: [PATCH] Run test in serial 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. --- tests/tests.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/tests.rs b/tests/tests.rs index 66e7085912..1f8864e0b1 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")