diff options
author | Björn Gustavsson <[email protected]> | 2016-02-26 06:47:38 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-03-09 12:05:19 +0100 |
commit | db87ef023f4660fd2129f30dbbff05e73bff3dd5 (patch) | |
tree | b97030bda2efea02fc58e5f0eaebd1450bb00d82 /lib/stdlib/test/supervisor_bridge_SUITE.erl | |
parent | aeccfd1c8441ac0caa0c86aac19747eb64bd267d (diff) | |
download | otp-db87ef023f4660fd2129f30dbbff05e73bff3dd5.tar.gz otp-db87ef023f4660fd2129f30dbbff05e73bff3dd5.tar.bz2 otp-db87ef023f4660fd2129f30dbbff05e73bff3dd5.zip |
Modernize use of timetraps
Either rely on the default 30 minutes timetrap, or set the timeout
using the supported methods in common_test.
Diffstat (limited to 'lib/stdlib/test/supervisor_bridge_SUITE.erl')
-rw-r--r-- | lib/stdlib/test/supervisor_bridge_SUITE.erl | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/stdlib/test/supervisor_bridge_SUITE.erl b/lib/stdlib/test/supervisor_bridge_SUITE.erl index 94e719bea1..768ff77be5 100644 --- a/lib/stdlib/test/supervisor_bridge_SUITE.erl +++ b/lib/stdlib/test/supervisor_bridge_SUITE.erl @@ -30,7 +30,9 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -suite() -> [{ct_hooks,[ts_install_cth]}]. +suite() -> + [{ct_hooks,[ts_install_cth]}, + {timetrap,{minutes,1}}]. all() -> [starting, mini_terminate, mini_die, badstart, simple_global_supervisor]. @@ -77,9 +79,9 @@ miniappl(N) -> process_flag(trap_exit,true), ?line {ok,Server} = start(3), ?line Client = spawn_link(?MODULE,client,[N]), - ?line Handle = test_server:timetrap(2000), - ?line miniappl_loop(Client,Server), - ?line test_server:timetrap_cancel(Handle). + ct:timetrap({seconds,2}), + miniappl_loop(Client, Server). + miniappl_loop([],[]) -> ok; @@ -173,8 +175,6 @@ terminate(_Reason, _State) -> badstart(suite) -> []; badstart(doc) -> "Test various bad ways of starting a supervisor bridge."; badstart(Config) when is_list(Config) -> - ?line Dog = test_server:timetrap(test_server:minutes(1)), - %% Various bad arguments. ?line {'EXIT',_} = @@ -199,7 +199,6 @@ badstart(Config) when is_list(Config) -> ?line receive {'EXIT', Pid, killed} -> ok end, - ?line test_server:timetrap_cancel(Dog), ok. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -208,7 +207,6 @@ badstart(Config) when is_list(Config) -> simple_global_supervisor(suite) -> []; simple_global_supervisor(doc) -> "Globally registered supervisor."; simple_global_supervisor(Config) when is_list(Config) -> - ?line Dog = test_server:timetrap({seconds,10}), Child = {child, {?MODULE,server9212,[]}, permanent, 2000, worker, []}, InitResult = {ok, {{one_for_all,3,60}, [Child]}}, @@ -225,7 +223,6 @@ simple_global_supervisor(Config) when is_list(Config) -> ?line process_flag(trap_exit, true), exit(Sup, kill), ?line receive {'EXIT', Sup, killed} -> ok end, - ?line test_server:timetrap_cancel(Dog), ok. server9212() -> |