mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Fix the sys trap_exit tests
The processes go down slower now so that caused intermittent issues.
This commit is contained in:
parent
e11279e0d2
commit
a002df4560
1 changed files with 5 additions and 4 deletions
|
@ -21,6 +21,7 @@
|
||||||
-import(ct_helper, [get_parent_pid/1]).
|
-import(ct_helper, [get_parent_pid/1]).
|
||||||
-import(ct_helper, [get_remote_pid_tcp/1]).
|
-import(ct_helper, [get_remote_pid_tcp/1]).
|
||||||
-import(ct_helper, [get_remote_pid_tls/1]).
|
-import(ct_helper, [get_remote_pid_tls/1]).
|
||||||
|
-import(ct_helper, [is_process_down/1]).
|
||||||
-import(cowboy_test, [gun_open/1]).
|
-import(cowboy_test, [gun_open/1]).
|
||||||
|
|
||||||
all() ->
|
all() ->
|
||||||
|
@ -319,7 +320,7 @@ trap_exit_parent_exit_h1(Config) ->
|
||||||
Parent = get_parent_pid(Pid),
|
Parent = get_parent_pid(Pid),
|
||||||
Pid ! {'EXIT', Parent, shutdown},
|
Pid ! {'EXIT', Parent, shutdown},
|
||||||
{error, closed} = gen_tcp:recv(Socket, 0, 1000),
|
{error, closed} = gen_tcp:recv(Socket, 0, 1000),
|
||||||
false = is_process_alive(Pid),
|
true = is_process_down(Pid),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
trap_exit_parent_exit_h2(Config) ->
|
trap_exit_parent_exit_h2(Config) ->
|
||||||
|
@ -334,7 +335,7 @@ trap_exit_parent_exit_h2(Config) ->
|
||||||
Parent = get_parent_pid(Pid),
|
Parent = get_parent_pid(Pid),
|
||||||
Pid ! {'EXIT', Parent, shutdown},
|
Pid ! {'EXIT', Parent, shutdown},
|
||||||
{error, closed} = ssl:recv(Socket, 0, 1000),
|
{error, closed} = ssl:recv(Socket, 0, 1000),
|
||||||
false = is_process_alive(Pid),
|
true = is_process_down(Pid),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
trap_exit_parent_exit_ws(Config) ->
|
trap_exit_parent_exit_ws(Config) ->
|
||||||
|
@ -358,7 +359,7 @@ trap_exit_parent_exit_ws(Config) ->
|
||||||
Parent = get_parent_pid(Pid),
|
Parent = get_parent_pid(Pid),
|
||||||
Pid ! {'EXIT', Parent, shutdown},
|
Pid ! {'EXIT', Parent, shutdown},
|
||||||
{error, closed} = gen_tcp:recv(Socket, 0, 1000),
|
{error, closed} = gen_tcp:recv(Socket, 0, 1000),
|
||||||
false = is_process_alive(Pid),
|
true = is_process_down(Pid),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
trap_exit_parent_exit_loop(Config) ->
|
trap_exit_parent_exit_loop(Config) ->
|
||||||
|
@ -375,7 +376,7 @@ trap_exit_parent_exit_loop(Config) ->
|
||||||
Pid ! {'EXIT', Parent, shutdown},
|
Pid ! {'EXIT', Parent, shutdown},
|
||||||
%% We exit normally but didn't send a response.
|
%% We exit normally but didn't send a response.
|
||||||
{ok, "HTTP/1.1 204 "} = gen_tcp:recv(Socket, 13, 1000),
|
{ok, "HTTP/1.1 204 "} = gen_tcp:recv(Socket, 13, 1000),
|
||||||
false = is_process_alive(Pid),
|
true = is_process_down(Pid),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
trap_exit_other_exit_h1(Config) ->
|
trap_exit_other_exit_h1(Config) ->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue