aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-12-30 07:29:51 +0100
committerBjörn Gustavsson <[email protected]>2012-01-04 16:12:28 +0100
commit374020f5f8caa321db46d593aa620ef989f9a758 (patch)
treec0d6c7c8f29fb69626838af18a715878d36eac92 /lib
parent19af90eb5654915de72f45127a17a75cb0d69cbe (diff)
downloadotp-374020f5f8caa321db46d593aa620ef989f9a758.tar.gz
otp-374020f5f8caa321db46d593aa620ef989f9a758.tar.bz2
otp-374020f5f8caa321db46d593aa620ef989f9a758.zip
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/compiler/test/test_lib.erl9
1 files changed, 8 insertions, 1 deletions
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) ->