diff options
author | Rickard Green <[email protected]> | 2017-01-11 16:18:30 +0100 |
---|---|---|
committer | Rickard Green <[email protected]> | 2017-01-11 16:18:30 +0100 |
commit | 4e48180f1e9a59e02a8b4a0276ea89b928910ad9 (patch) | |
tree | 5a1a50bc17739f4ce7a81fcd0d10f5833b5f86a5 /erts/emulator/test/process_SUITE.erl | |
parent | abfa6e4d3dc9d88de7a3b6cccffdcfc4f937d96d (diff) | |
parent | a67afb4e2e1e0dda8a8f818c844a2036e703c6f6 (diff) | |
download | otp-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.erl | 10 |
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) -> |