diff options
author | Rickard Green <[email protected]> | 2018-03-23 14:12:52 +0100 |
---|---|---|
committer | Rickard Green <[email protected]> | 2018-03-23 14:12:52 +0100 |
commit | 5c2acbd35150da5e6d3afba1f61bb8bb995bb80f (patch) | |
tree | 9250351fba7a64b5b1f9ff11fff7da8563ec3155 /erts/emulator/test | |
parent | be2bdf8c8c0bd3d110277fcbe8dc3611163087cc (diff) | |
parent | 83a289d4dff156f2c7203843a1437256545f5580 (diff) | |
download | otp-5c2acbd35150da5e6d3afba1f61bb8bb995bb80f.tar.gz otp-5c2acbd35150da5e6d3afba1f61bb8bb995bb80f.tar.bz2 otp-5c2acbd35150da5e6d3afba1f61bb8bb995bb80f.zip |
Merge branch 'rickard/signals/OTP-14589'
* rickard/signals/OTP-14589:
Fix VM probes compilation
Fix lock counting
Fix signal order for is_process_alive
Fix signal handling priority elevation
Diffstat (limited to 'erts/emulator/test')
-rw-r--r-- | erts/emulator/test/bif_SUITE.erl | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/erts/emulator/test/bif_SUITE.erl b/erts/emulator/test/bif_SUITE.erl index d16c6a320d..22706ae8b1 100644 --- a/erts/emulator/test/bif_SUITE.erl +++ b/erts/emulator/test/bif_SUITE.erl @@ -34,7 +34,8 @@ erl_crash_dump_bytes/1, is_builtin/1, error_stacktrace/1, error_stacktrace_during_call_trace/1, - group_leader_prio/1, group_leader_prio_dirty/1]). + group_leader_prio/1, group_leader_prio_dirty/1, + is_process_alive/1]). suite() -> [{ct_hooks,[ts_install_cth]}, @@ -48,7 +49,8 @@ all() -> atom_to_binary, binary_to_atom, binary_to_existing_atom, erl_crash_dump_bytes, min_max, erlang_halt, is_builtin, error_stacktrace, error_stacktrace_during_call_trace, - group_leader_prio, group_leader_prio_dirty]. + group_leader_prio, group_leader_prio_dirty, + is_process_alive]. %% Uses erlang:display to test that erts_printf does not do deep recursion display(Config) when is_list(Config) -> @@ -1076,6 +1078,27 @@ group_leader_prio_test(Dirty) -> TLs), ok. +is_process_alive(Config) when is_list(Config) -> + process_flag(priority, max), + Ps = lists:map(fun (_) -> + spawn_opt(fun () -> tok_loop() end, + [{priority, high}, link]) + end, + lists:seq(1, 2*erlang:system_info(schedulers))), + receive after 1000 -> ok end, %% Wait for load to spread + lists:foreach(fun (P) -> + %% Ensure that signal order is preserved + %% and that we are not starved due to + %% priority inversion + true = erlang:is_process_alive(P), + unlink(P), + true = erlang:is_process_alive(P), + exit(P, kill), + false = erlang:is_process_alive(P) + end, + Ps), + ok. + %% helpers id(I) -> I. |