summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Larsson <lukas@erlang.org>2021-11-25 17:33:52 +0100
committerLukas Larsson <lukas@erlang.org>2021-11-30 12:01:04 +0100
commit3e2a5bb3b1ff4e0a19fae99434eaccdcadac622c (patch)
treea40c6b194de9177f2e99377ab6c7e6b3ffcd6bb4
parentb56685c950d4b72c5da381f59cbc351f16e82435 (diff)
downloaderlang-3e2a5bb3b1ff4e0a19fae99434eaccdcadac622c.tar.gz
erts: Restore the number of dirty schedulers in scheduler SUITE
If the number of dirty schedulers is set to 1 when the number of schedulers is not when the scheduler_wall_time testcase runs things start to deadlock as processes that need to run on dirty schedulers are starved.
-rw-r--r--erts/emulator/test/scheduler_SUITE.erl5
-rw-r--r--erts/emulator/test/statistics_SUITE.erl3
2 files changed, 7 insertions, 1 deletions
diff --git a/erts/emulator/test/scheduler_SUITE.erl b/erts/emulator/test/scheduler_SUITE.erl
index faf16a96ef..f1683769dc 100644
--- a/erts/emulator/test/scheduler_SUITE.erl
+++ b/erts/emulator/test/scheduler_SUITE.erl
@@ -94,6 +94,7 @@ end_per_suite(Config) ->
catch erts_debug:set_internal_state(available_internal_state, false),
SchedOnln = proplists:get_value(schedulers_online, Config),
erlang:system_flag(schedulers_online, SchedOnln),
+ erlang:system_flag(dirty_cpu_schedulers_online, SchedOnln),
Config.
init_per_testcase(update_cpu_info, Config) ->
@@ -1248,10 +1249,12 @@ scheduler_suspend_basic(Config) when is_list(Config) ->
{skip, "Nothing to test"};
_ ->
Onln = erlang:system_info(schedulers_online),
+ DirtyOnln = erlang:system_info(dirty_cpu_schedulers_online),
try
scheduler_suspend_basic_test()
after
- erlang:system_flag(schedulers_online, Onln)
+ erlang:system_flag(schedulers_online, Onln),
+ erlang:system_flag(dirty_cpu_schedulers_online, DirtyOnln)
end
end.
diff --git a/erts/emulator/test/statistics_SUITE.erl b/erts/emulator/test/statistics_SUITE.erl
index 90fbedb94a..a336b54044 100644
--- a/erts/emulator/test/statistics_SUITE.erl
+++ b/erts/emulator/test/statistics_SUITE.erl
@@ -356,6 +356,9 @@ run_scheduler_wall_time_test(Type) ->
DirtyCPUSchedulers,
DirtyIOSchedulers]),
+ %% Assert that number of schedulers is the same as number of dirty schedulers
+ Schedulers = DirtyCPUSchedulers,
+
%% Let testserver and everyone else finish their work
timer:sleep(1500),
%% Empty load