aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2018-04-24 16:47:31 +0200
committerJohn Högberg <[email protected]>2018-04-24 16:47:31 +0200
commit77fcc67696c514b7fedd37720fdafe7533684e08 (patch)
tree3351dfa312acba4095e4bc4f7aeed7250ac6aad6 /erts
parente2a760e691d1b08a2396233fb50cefd98199ba12 (diff)
parent6d281624128b5877283df2e91e2c116c3a142f16 (diff)
downloadotp-77fcc67696c514b7fedd37720fdafe7533684e08.tar.gz
otp-77fcc67696c514b7fedd37720fdafe7533684e08.tar.bz2
otp-77fcc67696c514b7fedd37720fdafe7533684e08.zip
Merge branch 'john/erts/fix-lcnt-toggle-test'
* john/erts/fix-lcnt-toggle-test: Disregard locks that can't be toggled in lcnt_SUITE
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/test/lcnt_SUITE.erl17
1 files changed, 14 insertions, 3 deletions
diff --git a/erts/emulator/test/lcnt_SUITE.erl b/erts/emulator/test/lcnt_SUITE.erl
index 4e52c2813c..dfffd662e2 100644
--- a/erts/emulator/test/lcnt_SUITE.erl
+++ b/erts/emulator/test/lcnt_SUITE.erl
@@ -87,8 +87,9 @@ wait_for_empty_lock_list() ->
wait_for_empty_lock_list(10).
wait_for_empty_lock_list(Tries) when Tries > 0 ->
try_flush_cleanup_ops(),
- case erts_debug:lcnt_collect() of
- [{duration, _}, {locks, []}] ->
+ [{duration, _}, {locks, Locks}] = erts_debug:lcnt_collect(),
+ case remove_untoggleable_locks(Locks) of
+ [] ->
ok;
_ ->
timer:sleep(50),
@@ -124,7 +125,7 @@ toggle_lock_counting(Config) when is_list(Config) ->
get_lock_info_for(Categories) when is_list(Categories) ->
ok = erts_debug:lcnt_control(mask, Categories),
[{duration, _}, {locks, Locks}] = erts_debug:lcnt_collect(),
- Locks;
+ remove_untoggleable_locks(Locks);
get_lock_info_for(Category) when is_atom(Category) ->
get_lock_info_for([Category]).
@@ -178,3 +179,13 @@ registered_db_tables(Config) when is_list(Config) ->
(_Lock) -> false
end, DbLocks),
ok.
+
+%% Not all locks can be toggled on or off due to technical limitations, so we
+%% need to filter them out when checking whether we successfully disabled lock
+%% counting.
+remove_untoggleable_locks([]) ->
+ [];
+remove_untoggleable_locks([{resource_monitors, _, _, _} | T]) ->
+ remove_untoggleable_locks(T);
+remove_untoggleable_locks([H | T]) ->
+ [H | remove_untoggleable_locks(T)].