aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/process_SUITE.erl
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2017-01-11 16:18:30 +0100
committerRickard Green <[email protected]>2017-01-11 16:18:30 +0100
commit4e48180f1e9a59e02a8b4a0276ea89b928910ad9 (patch)
tree5a1a50bc17739f4ce7a81fcd0d10f5833b5f86a5 /erts/emulator/test/process_SUITE.erl
parentabfa6e4d3dc9d88de7a3b6cccffdcfc4f937d96d (diff)
parenta67afb4e2e1e0dda8a8f818c844a2036e703c6f6 (diff)
downloadotp-4e48180f1e9a59e02a8b4a0276ea89b928910ad9.tar.gz
otp-4e48180f1e9a59e02a8b4a0276ea89b928910ad9.tar.bz2
otp-4e48180f1e9a59e02a8b4a0276ea89b928910ad9.zip
Merge branch 'rickard/test-fix' into maint
* rickard/test-fix: Fix processes() BIF test cases
Diffstat (limited to 'erts/emulator/test/process_SUITE.erl')
-rw-r--r--erts/emulator/test/process_SUITE.erl10
1 files changed, 10 insertions, 0 deletions
diff --git a/erts/emulator/test/process_SUITE.erl b/erts/emulator/test/process_SUITE.erl
index 2289cbabc7..0a6eb7ffac 100644
--- a/erts/emulator/test/process_SUITE.erl
+++ b/erts/emulator/test/process_SUITE.erl
@@ -1622,6 +1622,7 @@ spawn_initial_hangarounds(_Cleaner, NP, Max, Len, HAs) when NP > Max ->
{Len, HAs};
spawn_initial_hangarounds(Cleaner, NP, Max, Len, HAs) ->
Skip = 30,
+ wait_for_proc_slots(Skip+3),
HA1 = spawn_opt(?MODULE, hangaround, [Cleaner, initial_hangaround],
[{priority, low}]),
HA2 = spawn_opt(?MODULE, hangaround, [Cleaner, initial_hangaround],
@@ -1631,6 +1632,15 @@ spawn_initial_hangarounds(Cleaner, NP, Max, Len, HAs) ->
spawn_drop(Skip),
spawn_initial_hangarounds(Cleaner, NP+Skip, Max, Len+3, [HA1,HA2,HA3|HAs]).
+wait_for_proc_slots(MinFreeSlots) ->
+ case erlang:system_info(process_limit) - erlang:system_info(process_count) of
+ FreeSlots when FreeSlots < MinFreeSlots ->
+ receive after 10 -> ok end,
+ wait_for_proc_slots(MinFreeSlots);
+ _FreeSlots ->
+ ok
+ end.
+
spawn_drop(N) when N =< 0 ->
ok;
spawn_drop(N) ->