aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/process_SUITE.erl
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2017-01-11 16:18:59 +0100
committerRickard Green <[email protected]>2017-01-11 16:18:59 +0100
commit2d46cd4302119a46b290520b2b679a8a591adb43 (patch)
tree47c6e97fc12cad973fb8ee19bcba327e62f2abe1 /erts/emulator/test/process_SUITE.erl
parent3406c9e2c1c8870f33b383cdf8d85de1bc0f9cf1 (diff)
parent4e48180f1e9a59e02a8b4a0276ea89b928910ad9 (diff)
downloadotp-2d46cd4302119a46b290520b2b679a8a591adb43.tar.gz
otp-2d46cd4302119a46b290520b2b679a8a591adb43.tar.bz2
otp-2d46cd4302119a46b290520b2b679a8a591adb43.zip
Merge branch 'maint'
* maint: 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 3b8f0072f2..5712c9fa74 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) ->