Skip to content

Commit

Permalink
Add test.
Browse files Browse the repository at this point in the history
With this change to the test but not the fix in the previous commit, running
os_signal_SUITE with emulator arg +Bd or +Bi will fail (BEAM will die with a
signal, which is not the best way to fail a test, but we don't have a shell
test suite to catch it).

To confirm, you can use ts, with
`ts:run(emulator, os_signal_SUITE, [{vars, [{erl_start_args, "+Bd"}]}]).`.
  • Loading branch information
jktomer committed Feb 26, 2021
1 parent 305aae3 commit 7feebda
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions erts/emulator/test/os_signal_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ suite() ->
all() ->
case os:type() of
{win32, _} -> [];
_ -> [set_unset,
t_sighup,
_ -> [t_sighup,
t_sigusr1,
t_sigusr2,
t_sigterm,
t_sigalrm,
t_sigchld,
t_sigchld_fork]
t_sigchld_fork,
set_unset]
end.

init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) ->
Expand Down Expand Up @@ -135,7 +135,7 @@ t_sighup(_Config) ->
t_sigusr1(_Config) ->
Pid1 = setup_service(),
OsPid = os:getpid(),
os:set_signal(sigusr1, handle),
% shouldn't need to explicitly set_signal to handle USR1, it's the default
ok = kill("USR1", OsPid),
ok = kill("USR1", OsPid),
ok = kill("USR1", OsPid),
Expand All @@ -157,7 +157,7 @@ t_sigusr1(_Config) ->
Msgs2 = fetch_msgs(Pid2),
io:format("Msgs2: ~p~n", [Msgs2]),
[] = Msgs2,
%% reset to ignore (it's the default)
%% reset to handle (default) so as not to break other tests
os:set_signal(sigusr1, handle),
ok.

Expand Down

0 comments on commit 7feebda

Please sign in to comment.