From 374020f5f8caa321db46d593aa620ef989f9a758 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Fri, 30 Dec 2011 07:29:51 +0100
Subject: test_lib:p_run/2: Be careful about how many parallel processes we use

We probably don't gain anything by using more processes than available
schedulers. Also, if 'cover' is being run, using more than one process
may make it slower, so we will be very conservative and use only one
process in that case.
---
 lib/compiler/test/test_lib.erl | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/compiler/test/test_lib.erl b/lib/compiler/test/test_lib.erl
index 53d8c04169..2295592a38 100644
--- a/lib/compiler/test/test_lib.erl
+++ b/lib/compiler/test/test_lib.erl
@@ -77,7 +77,14 @@ get_data_dir(Config) ->
 %%  Will fail the test case if there were any errors.
 
 p_run(Test, List) ->
-    N = erlang:system_info(schedulers) + 1,
+    N = case ?t:is_cover() of
+	    false ->
+		erlang:system_info(schedulers);
+	    true ->
+		%% Cover is running. Using more than one process
+		%% will probably only slow down compilation.
+		1
+	end,
     p_run_loop(Test, List, N, [], 0, 0).
 
 p_run_loop(_, [], _, [], Errors, Ws) ->
-- 
cgit v1.2.3