diff options
author | John Högberg <[email protected]> | 2017-12-05 08:39:44 +0100 |
---|---|---|
committer | John Högberg <[email protected]> | 2017-12-05 08:39:44 +0100 |
commit | 901de169dcd4d81099523094af2b39c8ab89f6f9 (patch) | |
tree | 4d5ddb847ff32bd275c03e494d0dcc9ec275a534 /erts/emulator/test | |
parent | 333556f4323f8d8a9e22a613a8591032b84b28d8 (diff) | |
parent | fb99e17d04bddfcb43f54388c93302ea32d60b4a (diff) | |
download | otp-901de169dcd4d81099523094af2b39c8ab89f6f9.tar.gz otp-901de169dcd4d81099523094af2b39c8ab89f6f9.tar.bz2 otp-901de169dcd4d81099523094af2b39c8ab89f6f9.zip |
Merge branch 'john/erts/lcnt-fix-reg-proc-names/OTP-14803' into maint
Diffstat (limited to 'erts/emulator/test')
-rw-r--r-- | erts/emulator/test/lcnt_SUITE.erl | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/erts/emulator/test/lcnt_SUITE.erl b/erts/emulator/test/lcnt_SUITE.erl index 504b9b54cf..4e52c2813c 100644 --- a/erts/emulator/test/lcnt_SUITE.erl +++ b/erts/emulator/test/lcnt_SUITE.erl @@ -28,14 +28,16 @@ init_per_testcase/2, end_per_testcase/2]). -export( - [toggle_lock_counting/1, error_on_invalid_category/1, preserve_locks/1]). + [toggle_lock_counting/1, error_on_invalid_category/1, preserve_locks/1, + registered_processes/1, registered_db_tables/1]). suite() -> [{ct_hooks,[ts_install_cth]}, {timetrap, {seconds, 10}}]. all() -> - [toggle_lock_counting, error_on_invalid_category, preserve_locks]. + [toggle_lock_counting, error_on_invalid_category, preserve_locks, + registered_processes, registered_db_tables]. init_per_suite(Config) -> case erlang:system_info(lock_counting) of @@ -154,3 +156,25 @@ preserve_locks(Config) when is_list(Config) -> error_on_invalid_category(Config) when is_list(Config) -> {error, badarg, q_invalid} = erts_debug:lcnt_control(mask, [q_invalid]), ok. + +registered_processes(Config) when is_list(Config) -> + %% There ought to be at least one registered process (init/code_server) + erts_debug:lcnt_control(mask, [process]), + [_, {locks, ProcLocks}] = erts_debug:lcnt_collect(), + true = lists:any( + fun + ({proc_main, RegName, _, _}) when is_atom(RegName) -> true; + (_Lock) -> false + end, ProcLocks), + ok. + +registered_db_tables(Config) when is_list(Config) -> + %% There ought to be at least one registered table (code) + erts_debug:lcnt_control(mask, [db]), + [_, {locks, DbLocks}] = erts_debug:lcnt_collect(), + true = lists:any( + fun + ({db_tab, RegName, _, _}) when is_atom(RegName) -> true; + (_Lock) -> false + end, DbLocks), + ok. |