aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-03-02 16:10:02 +0100
committerBjörn Gustavsson <[email protected]>2016-03-09 14:02:50 +0100
commit9870d22b2401b60221aa42c78bdb7ec4a812e9e7 (patch)
treef0d4e4d0feb88c64695cb63d6d072969b2a157ff /lib/kernel
parentbb1eb9bfa336afeb945fd1a5c494cfdaefb5183d (diff)
downloadotp-9870d22b2401b60221aa42c78bdb7ec4a812e9e7.tar.gz
otp-9870d22b2401b60221aa42c78bdb7ec4a812e9e7.tar.bz2
otp-9870d22b2401b60221aa42c78bdb7ec4a812e9e7.zip
Modernize timetraps
Diffstat (limited to 'lib/kernel')
-rw-r--r--lib/kernel/test/application_SUITE.erl18
-rw-r--r--lib/kernel/test/bif_SUITE.erl17
-rw-r--r--lib/kernel/test/code_SUITE.erl12
-rw-r--r--lib/kernel/test/disk_log_SUITE.erl15
-rw-r--r--lib/kernel/test/erl_boot_server_SUITE.erl16
-rw-r--r--lib/kernel/test/erl_distribution_SUITE.erl18
-rw-r--r--lib/kernel/test/erl_distribution_wb_SUITE.erl12
-rw-r--r--lib/kernel/test/erl_prim_loader_SUITE.erl16
-rw-r--r--lib/kernel/test/error_handler_SUITE.erl4
-rw-r--r--lib/kernel/test/error_logger_SUITE.erl4
-rw-r--r--lib/kernel/test/error_logger_warn_SUITE.erl15
-rw-r--r--lib/kernel/test/file_SUITE.erl150
-rw-r--r--lib/kernel/test/file_name_SUITE.erl12
-rw-r--r--lib/kernel/test/gen_sctp_SUITE.erl12
-rw-r--r--lib/kernel/test/gen_tcp_api_SUITE.erl13
-rw-r--r--lib/kernel/test/gen_tcp_echo_SUITE.erl13
-rw-r--r--lib/kernel/test/gen_tcp_misc_SUITE.erl43
-rw-r--r--lib/kernel/test/gen_udp_SUITE.erl11
-rw-r--r--lib/kernel/test/global_SUITE.erl3
-rw-r--r--lib/kernel/test/global_group_SUITE.erl41
-rw-r--r--lib/kernel/test/heart_SUITE.erl13
-rw-r--r--lib/kernel/test/inet_SUITE.erl24
-rw-r--r--lib/kernel/test/inet_res_SUITE.erl8
-rw-r--r--lib/kernel/test/inet_sockopt_SUITE.erl12
-rw-r--r--lib/kernel/test/init_SUITE.erl51
-rw-r--r--lib/kernel/test/interactive_shell_SUITE.erl13
-rw-r--r--lib/kernel/test/kernel_SUITE.erl7
-rw-r--r--lib/kernel/test/kernel_config_SUITE.erl6
-rw-r--r--lib/kernel/test/multi_load_SUITE.erl4
-rw-r--r--lib/kernel/test/os_SUITE.erl6
-rw-r--r--lib/kernel/test/pdict_SUITE.erl12
-rw-r--r--lib/kernel/test/pg2_SUITE.erl24
-rw-r--r--lib/kernel/test/prim_file_SUITE.erl51
-rw-r--r--lib/kernel/test/ram_file_SUITE.erl28
-rw-r--r--lib/kernel/test/rpc_SUITE.erl29
-rw-r--r--lib/kernel/test/seq_trace_SUITE.erl19
-rw-r--r--lib/kernel/test/wrap_log_reader_SUITE.erl12
-rw-r--r--lib/kernel/test/zlib_SUITE.erl13
38 files changed, 233 insertions, 544 deletions
diff --git a/lib/kernel/test/application_SUITE.erl b/lib/kernel/test/application_SUITE.erl
index 0ff512bb6e..93c79e588b 100644
--- a/lib/kernel/test/application_SUITE.erl
+++ b/lib/kernel/test/application_SUITE.erl
@@ -44,10 +44,10 @@
-export([init_per_testcase/2, end_per_testcase/2, start_type/0,
start_phase/0, conf_change/0]).
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(2)).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,2}}].
all() ->
[failover, failover_comp, permissions, load,
@@ -82,20 +82,14 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(otp_2973=Case, Config) ->
code:add_path(?config(data_dir,Config)),
- Dog = test_server:timetrap(?default_timeout),
- [{?TESTCASE, Case}, {watchdog, Dog}|Config];
+ [{?TESTCASE, Case}|Config];
init_per_testcase(Case, Config) ->
- Dog = test_server:timetrap(?default_timeout),
- [{?TESTCASE, Case}, {watchdog, Dog}|Config].
+ [{?TESTCASE, Case}|Config].
end_per_testcase(otp_2973, Config) ->
code:del_path(?config(data_dir,Config)),
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
ok;
-end_per_testcase(_Case, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
-define(UNTIL(Seq), loop_until_true(fun() -> Seq end)).
diff --git a/lib/kernel/test/bif_SUITE.erl b/lib/kernel/test/bif_SUITE.erl
index 284ca8f377..8fb84b5d1c 100644
--- a/lib/kernel/test/bif_SUITE.erl
+++ b/lib/kernel/test/bif_SUITE.erl
@@ -40,18 +40,15 @@
-include_lib("common_test/include/ct.hrl").
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(1)).
-
init_per_testcase(_Case, Config) ->
- ?line Dog = ?t:timetrap(?default_timeout),
- [{watchdog, Dog} | Config].
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+ Config.
+
+end_per_testcase(_Case, _Config) ->
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[{group, spawn_tests}, {group, spawn_link_tests},
@@ -533,7 +530,6 @@ wilderness(doc) ->
wilderness(suite) ->
[];
wilderness(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?default_timeout),
?line OKParams = {512, 8},
?line Alloc = erlang:system_info(allocator),
?line test_server:format("Test server allocator info:~n~p", [Alloc]),
@@ -549,7 +545,6 @@ wilderness(Config) when is_list(Config) ->
"Allocator used: "
++ atom_to_list(OtherAllocator)}
end,
- ?line test_server:timetrap_cancel(Dog),
Result.
run_wilderness_test({Set_tt, Set_tp}, {Exp_tt, Exp_tp}) ->
diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl
index 13d3809ef6..bdd54f533e 100644
--- a/lib/kernel/test/code_SUITE.erl
+++ b/lib/kernel/test/code_SUITE.erl
@@ -46,7 +46,9 @@
-export([compile_load/4]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,5}}].
all() ->
[set_path, get_path, add_path, add_paths, del_path,
@@ -92,10 +94,8 @@ init_per_testcase(big_boot_embedded, Config) ->
{skip, "Needs crypto!"}
end;
init_per_testcase(_Func, Config) ->
- Dog=?t:timetrap(?t:minutes(5)),
- P=code:get_path(),
- P=code:get_path(),
- [{watchdog, Dog}, {code_path, P}|Config].
+ P = code:get_path(),
+ [{code_path, P}|Config].
end_per_testcase(TC, Config) when TC == mult_lib_roots;
TC == big_boot_embedded ->
@@ -108,8 +108,6 @@ end_per_testcase(_Func, Config) ->
end_per_testcase(Config) ->
code:purge(code_b_test),
- Dog=?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
P=?config(code_path, Config),
true=code:set_path(P),
P=code:get_path(),
diff --git a/lib/kernel/test/disk_log_SUITE.erl b/lib/kernel/test/disk_log_SUITE.erl
index 7600b02e90..ff105527a0 100644
--- a/lib/kernel/test/disk_log_SUITE.erl
+++ b/lib/kernel/test/disk_log_SUITE.erl
@@ -102,8 +102,6 @@
-export([client/4]).
--define(default_timeout, ?t:minutes(1)).
-
%% error_logger
-export([init/1,
handle_event/2, handle_call/2, handle_info/2,
@@ -139,7 +137,9 @@
change_size_after, default_size]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,2}}].
all() ->
[{group, halt_int}, {group, wrap_int},
@@ -194,13 +194,10 @@ end_per_group(_GroupName, Config) ->
-init_per_testcase(Case, Config) ->
- Dog=?t:timetrap(?t:minutes(2)),
- [{watchdog, Dog}|Config].
+init_per_testcase(_Case, Config) ->
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
diff --git a/lib/kernel/test/erl_boot_server_SUITE.erl b/lib/kernel/test/erl_boot_server_SUITE.erl
index 2450761ac9..b376b98812 100644
--- a/lib/kernel/test/erl_boot_server_SUITE.erl
+++ b/lib/kernel/test/erl_boot_server_SUITE.erl
@@ -34,7 +34,9 @@
%% Changed for the new erl_boot_server for R3A by Bjorn Gustavsson.
%%-----------------------------------------------------------------
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[start, start_link, stop, add, delete, responses].
@@ -59,7 +61,6 @@ end_per_group(_GroupName, Config) ->
start(doc) -> "Tests the erl_boot_server:start/1 function.";
start(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(50)),
?line [Host1, Host2|_] = good_hosts(Config),
%% Bad arguments.
@@ -85,12 +86,10 @@ start(Config) when is_list(Config) ->
?line exit(Pid2, kill),
test_server:sleep(1),
- ?line test_server:timetrap_cancel(Dog),
ok.
start_link(doc) -> "Tests the erl_boot_server:start_link/1 function.";
start_link(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line [Host1, Host2|_] = good_hosts(Config),
OldFlag = process_flag(trap_exit, true),
@@ -111,12 +110,10 @@ start_link(Config) when is_list(Config) ->
?line shutdown(Pid2),
process_flag(trap_exit, OldFlag),
- ?line test_server:timetrap_cancel(Dog),
ok.
stop(doc) -> "Tests that no processes are left if a boot server is killed.";
stop(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(50)),
?line [Host1|_] = good_hosts(Config),
%% Start a boot server and kill it. Make sure that any helper processes
@@ -135,12 +132,10 @@ stop(Config) when is_list(Config) ->
NotKilled ->
test_server:fail({not_killed, NotKilled})
end,
- ?line test_server:timetrap_cancel(Dog),
ok.
add(doc) -> "Tests the erl_boot_server:add/1 function.";
add(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line OldFlag = process_flag(trap_exit, true),
?line {ok, Pid1} = erl_boot_server:start_link([]),
?line [] = erl_boot_server:which_slaves(),
@@ -180,12 +175,10 @@ add(Config) when is_list(Config) ->
%% Cleanup.
?line shutdown(Pid1),
?line process_flag(trap_exit, OldFlag),
- ?line test_server:timetrap_cancel(Dog),
ok.
delete(doc) -> "Tests the erl_boot_server:delete/1 function.";
delete(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line OldFlag = process_flag(trap_exit, true),
?line [Host1, Host2, Host3|_] = good_hosts(Config),
@@ -227,12 +220,10 @@ delete(Config) when is_list(Config) ->
?line shutdown(Pid1),
?line process_flag(trap_exit, OldFlag),
- ?line test_server:timetrap_cancel(Dog),
ok.
responses(doc) -> "Tests erl_boot_server responses to slave requests.";
responses(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(30)),
?line process_flag(trap_exit, true),
%% Copy from inet_boot.hrl
EBOOT_PORT = 4368,
@@ -324,7 +315,6 @@ responses(Config) when is_list(Config) ->
ok
end,
- ?line test_server:timetrap_cancel(Dog),
Ret.
shutdown(Pid) ->
diff --git a/lib/kernel/test/erl_distribution_SUITE.erl b/lib/kernel/test/erl_distribution_SUITE.erl
index 3ac87384b4..2473ebd860 100644
--- a/lib/kernel/test/erl_distribution_SUITE.erl
+++ b/lib/kernel/test/erl_distribution_SUITE.erl
@@ -61,7 +61,9 @@
%% erl -sname master -rsh ctrsh
%%-----------------------------------------------------------------
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,4}}].
all() ->
[tick, tick_change, illegal_nodenames, hidden_node,
@@ -91,17 +93,14 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) ->
- Dog=?t:timetrap(?t:minutes(4)),
- [{watchdog, Dog}|Config].
+ Config.
-end_per_testcase(_Func, Config) ->
- Dog=?config(watchdog, Config),
- ?t:timetrap_cancel(Dog).
+end_per_testcase(_Func, _Config) ->
+ ok.
tick(suite) -> [];
tick(doc) -> [];
tick(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(120)),
PaDir = filename:dirname(code:which(erl_distribution_SUITE)),
%% First check that the normal case is OK!
@@ -162,7 +161,6 @@ tick(Config) when is_list(Config) ->
stop_node(Node),
test_server:fail("server node died")
end,
- ?line test_server:timetrap_cancel(Dog),
ok.
table_waste(doc) ->
@@ -190,7 +188,6 @@ illegal_nodenames(doc) ->
illegal_nodenames(suite) ->
[];
illegal_nodenames(Config) when is_list(Config) ->
- ?line Dog=?t:timetrap(?t:minutes(2)),
PaDir = filename:dirname(code:which(erl_distribution_SUITE)),
?line {ok, Node}=start_node(illegal_nodenames, "-pa " ++ PaDir),
monitor_node(Node, true),
@@ -203,7 +200,6 @@ illegal_nodenames(Config) when is_list(Config) ->
?t:fail("Remote node died.")
end,
stop_node(Node),
- ?t:timetrap_cancel(Dog),
ok.
pinger(Starter) ->
@@ -477,7 +473,6 @@ hidden_node(doc) ->
hidden_node(suite) ->
[];
hidden_node(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(40)),
PaDir = filename:dirname(code:which(?MODULE)),
VArgs = "-pa " ++ PaDir,
HArgs = "-hidden -pa " ++ PaDir,
@@ -501,7 +496,6 @@ hidden_node(Config) when is_list(Config) ->
sleep(5),
check_monitor_nodes_res(HMN, V),
stop_node(H),
- ?line ?t:timetrap_cancel(Dog),
ok.
connect_nodes(A, B) ->
diff --git a/lib/kernel/test/erl_distribution_wb_SUITE.erl b/lib/kernel/test/erl_distribution_wb_SUITE.erl
index e453cb2cdd..07e6dbbc86 100644
--- a/lib/kernel/test/erl_distribution_wb_SUITE.erl
+++ b/lib/kernel/test/erl_distribution_wb_SUITE.erl
@@ -79,7 +79,9 @@
-define(u32(X3,X2,X1,X0),
(((X3) bsl 24) bor ((X2) bsl 16) bor ((X1) bsl 8) bor (X0))).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[whitebox, switch_options, missing_compulsory_dflags].
@@ -101,12 +103,10 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) ->
- Dog=?t:timetrap(?t:minutes(1)),
- [{watchdog, Dog}|Config].
+ Config.
-end_per_testcase(_Func, Config) ->
- Dog=?config(watchdog, Config),
- ?t:timetrap_cancel(Dog).
+end_per_testcase(_Func, _Config) ->
+ ok.
switch_options(doc) ->
["Tests switching of options for the tcp port, as this is done"
diff --git a/lib/kernel/test/erl_prim_loader_SUITE.erl b/lib/kernel/test/erl_prim_loader_SUITE.erl
index bccca59b93..113367ff02 100644
--- a/lib/kernel/test/erl_prim_loader_SUITE.erl
+++ b/lib/kernel/test/erl_prim_loader_SUITE.erl
@@ -23,6 +23,7 @@
-include_lib("common_test/include/ct.hrl").
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
+ init_per_testcase/2,end_per_testcase/2,
init_per_group/2,end_per_group/2]).
-export([get_path/1, set_path/1, get_file/1, normalize_and_backslash/1,
@@ -32,13 +33,14 @@
primary_archive/1, virtual_dir_in_archive/1,
get_modules/1]).
--export([init_per_testcase/2, end_per_testcase/2]).
%%-----------------------------------------------------------------
%% Test suite for erl_prim_loader. (Most code is run during system start/stop.)
%%-----------------------------------------------------------------
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,3}}].
all() ->
[get_path, set_path, get_file,
@@ -64,13 +66,11 @@ end_per_group(_GroupName, Config) ->
Config.
-init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) ->
- Dog=?t:timetrap(?t:minutes(3)),
- [{watchdog, Dog}|Config].
+init_per_testcase(_Func, Config) ->
+ Config.
-end_per_testcase(_Func, Config) ->
- Dog=?config(watchdog, Config),
- ?t:timetrap_cancel(Dog).
+end_per_testcase(_Func, _Config) ->
+ ok.
get_path(doc) -> [];
get_path(Config) when is_list(Config) ->
diff --git a/lib/kernel/test/error_handler_SUITE.erl b/lib/kernel/test/error_handler_SUITE.erl
index d93ec643ce..6092eebb62 100644
--- a/lib/kernel/test/error_handler_SUITE.erl
+++ b/lib/kernel/test/error_handler_SUITE.erl
@@ -26,7 +26,9 @@
%% Callback from error_handler.
-export(['$handle_undefined_function'/2]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[undefined_function_handler].
diff --git a/lib/kernel/test/error_logger_SUITE.erl b/lib/kernel/test/error_logger_SUITE.erl
index fa0fc5b75c..917b6a9b9e 100644
--- a/lib/kernel/test/error_logger_SUITE.erl
+++ b/lib/kernel/test/error_logger_SUITE.erl
@@ -40,7 +40,9 @@
terminate/2]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[error_report, info_report, error, info, emulator, tty,
diff --git a/lib/kernel/test/error_logger_warn_SUITE.erl b/lib/kernel/test/error_logger_warn_SUITE.erl
index 40b3f6bd53..8e76912c73 100644
--- a/lib/kernel/test/error_logger_warn_SUITE.erl
+++ b/lib/kernel/test/error_logger_warn_SUITE.erl
@@ -42,11 +42,10 @@
end
end)()).
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(1)).
-
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[basic, warnings_info, warnings_errors, rb_basic,
@@ -70,11 +69,9 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
- Dog = ?t:timetrap(?default_timeout),
- [{watchdog, Dog} | Config].
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+ Config.
+
+end_per_testcase(_Case, _Config) ->
ok.
basic(doc) ->
diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl
index e9401e26ef..62a9adbb69 100644
--- a/lib/kernel/test/file_SUITE.erl
+++ b/lib/kernel/test/file_SUITE.erl
@@ -83,7 +83,7 @@
-export([unicode/1]).
-export([altname/1]).
--export([large_file/1, large_write/1]).
+-export([large_file/0, large_file/1, large_write/1]).
-export([read_line_1/1, read_line_2/1, read_line_3/1,read_line_4/1]).
@@ -112,7 +112,9 @@
-define(THROW_ERROR(RES), throw({fail, ?LINE, RES})).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[unicode, altname, read_write_file, {group, dirs},
@@ -326,7 +328,6 @@ old_io_protocol(suite) ->
old_io_protocol(doc) ->
["Test that the old file IO protocol =< R16B still works"];
old_io_protocol(Config) when is_list(Config) ->
- Dog = test_server:timetrap(test_server:seconds(5)),
RootDir = ?config(priv_dir,Config),
Name = filename:join(RootDir,
atom_to_list(?MODULE)
@@ -340,7 +341,6 @@ old_io_protocol(Config) when is_list(Config) ->
end,
ok = ?FILE_MODULE:close(Fd),
{ok, <<>>} = ?FILE_MODULE:read_file(Name),
- test_server:timetrap_cancel(Dog),
[] = flush(),
ok.
@@ -496,7 +496,6 @@ um_filename(Str = [_|_], Dir, Options) ->
read_write_file(suite) -> [];
read_write_file(doc) -> [];
read_write_file(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(priv_dir,Config),
?line Name = filename:join(RootDir,
atom_to_list(?MODULE)
@@ -547,7 +546,6 @@ read_write_file(Config) when is_list(Config) ->
?line {Bin1,Bin2} = split_binary(Bin5,byte_size(Bin1)),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -556,7 +554,6 @@ read_write_file(Config) when is_list(Config) ->
make_del_dir(suite) -> [];
make_del_dir(doc) -> [];
make_del_dir(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(priv_dir,Config),
?line NewDir = filename:join(RootDir,
atom_to_list(?MODULE)
@@ -611,8 +608,7 @@ make_del_dir(Config) when is_list(Config) ->
?line {error, enoent} = ?FILE_MODULE:del_dir(""),
?line {error, badarg} = ?FILE_MODULE:del_dir([3,2,1,{}]),
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog)
+ ?line [] = flush()
after
?FILE_MODULE:set_cwd(CurrentDir)
end,
@@ -621,7 +617,6 @@ make_del_dir(Config) when is_list(Config) ->
cur_dir_0(suite) -> [];
cur_dir_0(doc) -> [];
cur_dir_0(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
%% Find out the current dir, and cd to it ;-)
?line {ok,BaseDir} = ?FILE_MODULE:get_cwd(),
?line Dir1 = BaseDir ++ "", %% Check that it's a string
@@ -681,7 +676,6 @@ cur_dir_0(Config) when is_list(Config) ->
?line false = lists:member($\\, BaseDir),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
%% Tests ?FILE_MODULE:get_cwd/1.
@@ -689,8 +683,6 @@ cur_dir_0(Config) when is_list(Config) ->
cur_dir_1(suite) -> [];
cur_dir_1(doc) -> [];
cur_dir_1(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
-
?line case os:type() of
{win32, _} ->
win_cur_dir_1(Config);
@@ -698,7 +690,6 @@ cur_dir_1(Config) when is_list(Config) ->
?line {error, enotsup} = ?FILE_MODULE:get_cwd("d:")
end,
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
win_cur_dir_1(_Config) ->
@@ -866,7 +857,6 @@ start_node(Name, Args) ->
open1(suite) -> [];
open1(doc) -> [];
open1(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(priv_dir,Config),
?line NewDir = filename:join(RootDir,
atom_to_list(?MODULE)
@@ -889,7 +879,6 @@ open1(Config) when is_list(Config) ->
?line eof = io:get_line(Fd3,''),
?line ok = ?FILE_MODULE:close(Fd3),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
%% Tests all open modes.
@@ -897,7 +886,6 @@ open1(Config) when is_list(Config) ->
old_modes(suite) -> [];
old_modes(doc) -> [];
old_modes(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
?line RootDir = ?config(priv_dir, Config),
?line NewDir = filename:join(RootDir,
atom_to_list(?MODULE)
@@ -924,14 +912,12 @@ old_modes(Config) when is_list(Config) ->
?line ok = ?FILE_MODULE:close(Fd3),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
new_modes(suite) -> [];
new_modes(doc) -> [];
new_modes(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
?line RootDir = ?config(priv_dir, Config),
?line NewDir = filename:join(RootDir,
atom_to_list(?MODULE)
@@ -987,13 +973,11 @@ new_modes(Config) when is_list(Config) ->
end,
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
path_open(suite) -> [];
path_open(doc) -> [];
path_open(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(priv_dir,Config),
?line NewDir = filename:join(RootDir,
atom_to_list(?MODULE)
@@ -1032,13 +1016,11 @@ path_open(Config) when is_list(Config) ->
?line ok = ?FILE_MODULE:close(Fd3),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
close(suite) -> [];
close(doc) -> [];
close(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(priv_dir,Config),
?line Name = filename:join(RootDir,
atom_to_list(?MODULE)
@@ -1056,13 +1038,11 @@ close(Config) when is_list(Config) ->
?line io:format("Second close gave: ~p",[Val]),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
access(suite) -> [];
access(doc) -> [];
access(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(priv_dir,Config),
?line Name = filename:join(RootDir,
atom_to_list(?MODULE)
@@ -1085,7 +1065,6 @@ access(Config) when is_list(Config) ->
?line ok = ?FILE_MODULE:close(Fd3),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
%% Tests ?FILE_MODULE:read/2 and ?FILE_MODULE:write/2.
@@ -1093,7 +1072,6 @@ access(Config) when is_list(Config) ->
read_write(suite) -> [];
read_write(doc) -> [];
read_write(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(priv_dir, Config),
?line NewDir = filename:join(RootDir,
atom_to_list(?MODULE)
@@ -1122,7 +1100,6 @@ read_write(Config) when is_list(Config) ->
?line {ok, Fd4} = ?FILE_MODULE:open(Name4, [read, write, raw, binary]),
?line read_write_test(Fd4, MarkerB, <<>>),
- ?line test_server:timetrap_cancel(Dog),
ok.
read_write_test(File, Marker, Empty) ->
@@ -1142,7 +1119,6 @@ read_write_test(File, Marker, Empty) ->
pread_write(suite) -> [];
pread_write(doc) -> [];
pread_write(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(priv_dir, Config),
?line NewDir = filename:join(RootDir,
atom_to_list(?MODULE)
@@ -1171,7 +1147,6 @@ pread_write(Config) when is_list(Config) ->
?line {ok, Fd4} = ?FILE_MODULE:open(Name4, [binary, read, write, raw]),
?line pread_write_test(Fd4, Bin),
- ?line test_server:timetrap_cancel(Dog),
ok.
pread_write_test(File, Data) ->
@@ -1200,7 +1175,6 @@ pread_write_test(File, Data) ->
append(doc) -> "Test appending to a file.";
append(suite) -> [];
append(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(priv_dir, Config),
?line NewDir = filename:join(RootDir,
atom_to_list(?MODULE)
@@ -1228,13 +1202,11 @@ append(Config) when is_list(Config) ->
?line {ok, Expected} = ?FILE_MODULE:read_file(Name1),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
open_errors(suite) -> [];
open_errors(doc) -> [];
open_errors(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line DataDir =
filename:dirname(
filename:join(?config(data_dir, Config), "x")),
@@ -1246,13 +1218,11 @@ open_errors(Config) when is_list(Config) ->
?line {eisdir,eisdir,eisdir,eisdir} = {E1,E2,E3,E4},
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
exclusive(suite) -> [];
exclusive(doc) -> "Test exclusive access to a file.";
exclusive(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(priv_dir,Config),
?line NewDir = filename:join(RootDir,
atom_to_list(?MODULE)
@@ -1262,7 +1232,6 @@ exclusive(Config) when is_list(Config) ->
?line {ok, Fd} = ?FILE_MODULE:open(Name, [write, exclusive]),
?line {error, eexist} = ?FILE_MODULE:open(Name, [write, exclusive]),
?line ok = ?FILE_MODULE:close(Fd),
- ?line test_server:timetrap_cancel(Dog),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1271,7 +1240,6 @@ exclusive(Config) when is_list(Config) ->
pos1(suite) -> [];
pos1(doc) -> [];
pos1(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(priv_dir,Config),
?line Name = filename:join(RootDir,
atom_to_list(?MODULE)
@@ -1331,13 +1299,11 @@ pos1(Config) when is_list(Config) ->
?line {error, einval} = ?FILE_MODULE:position(Fd2,{eof,-9}),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
pos2(suite) -> [];
pos2(doc) -> [];
pos2(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(priv_dir,Config),
?line Name = filename:join(RootDir,
atom_to_list(?MODULE)
@@ -1355,13 +1321,11 @@ pos2(Config) when is_list(Config) ->
?line [] = flush(),
?line io:format("DONE"),
- ?line test_server:timetrap_cancel(Dog),
ok.
pos3(suite) -> [];
pos3(doc) -> ["When it does not use raw mode, file:position had a bug."];
pos3(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(data_dir, Config),
?line Name = filename:join(RootDir, "realmen.html.gz"),
@@ -1377,13 +1341,11 @@ pos3(Config) when is_list(Config) ->
%% is guaranteed to be unchanged after an error return. On e.g
%% Windows there is nothing stated about this in the documentation.
- ?line test_server:timetrap_cancel(Dog),
ok.
file_info_basic_file(suite) -> [];
file_info_basic_file(doc) -> [];
file_info_basic_file(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(priv_dir, Config),
%% Create a short file.
@@ -1410,14 +1372,11 @@ file_info_basic_file(Config) when is_list(Config) ->
?line all_integers(tuple_to_list(AccessTime) ++ tuple_to_list(ModifyTime)),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
file_info_basic_directory(suite) -> [];
file_info_basic_directory(doc) -> [];
file_info_basic_directory(Config) when is_list(Config) ->
- Dog = test_server:timetrap(test_server:seconds(5)),
-
%% Note: filename:join/1 removes any trailing slash,
%% which is essential for ?FILE_MODULE:file_info/1 to work on
%% platforms such as Windows95.
@@ -1438,7 +1397,7 @@ file_info_basic_directory(Config) when is_list(Config) ->
_ ->
?line test_directory("/", read)
end,
- test_server:timetrap_cancel(Dog).
+ ok.
test_directory(Name, ExpectedAccess) ->
{ok,FileInfo} = ?FILE_MODULE:read_file_info(Name),
@@ -1467,7 +1426,6 @@ all_integers([]) -> ok.
file_info_bad(suite) -> [];
file_info_bad(doc) -> [];
file_info_bad(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = filename:join([?config(priv_dir, Config)]),
FileName = filename:join(RootDir, atom_to_list(?MODULE) ++ "_nonexistent"),
{error,enoent} = ?FILE_MODULE:read_file_info(FileName),
@@ -1475,7 +1433,6 @@ file_info_bad(Config) when is_list(Config) ->
?line {error, enoent} = ?FILE_MODULE:read_file_info(""),
{error, enoent} = ?FILE_MODULE:read_file_info("", [raw]),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
%% Test that the file times behave as they should.
@@ -1483,14 +1440,12 @@ file_info_bad(Config) when is_list(Config) ->
file_info_times(suite) -> [];
file_info_times(doc) -> [];
file_info_times(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(60)),
%% We have to try this twice, since if the test runs across the change
%% of a month the time diff calculations will fail. But it won't happen
%% if you run it twice in succession.
?line test_server:m_out_of_n(
1,2,
fun() -> ?line file_info_int(Config) end),
- ?line test_server:timetrap_cancel(Dog),
ok.
file_info_int(Config) ->
@@ -1579,7 +1534,6 @@ filter_atime(Atime, Config) ->
file_write_file_info(suite) -> [];
file_write_file_info(doc) -> [];
file_write_file_info(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
?line RootDir = get_good_directory(Config),
?line test_server:format("RootDir = ~p", [RootDir]),
@@ -1651,7 +1605,6 @@ file_write_file_info(Config) when is_list(Config) ->
?line ?FILE_MODULE:write_file_info(Name1, #file_info{mode=8#600}),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
%% Returns a directory on a file system that has correct file times.
@@ -1663,7 +1616,6 @@ get_good_directory(Config) ->
consult1(suite) -> [];
consult1(doc) -> [];
consult1(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(priv_dir,Config),
?line Name = filename:join(RootDir,
atom_to_list(?MODULE)
@@ -1688,13 +1640,11 @@ consult1(Config) when is_list(Config) ->
?line {error, enoent} = ?FILE_MODULE:consult(Name ++ ".nonexistent"),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
path_consult(suite) -> [];
path_consult(doc) -> [];
path_consult(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(priv_dir,Config),
?line FileName = atom_to_list(?MODULE)++"_path_consult.fil",
?line Name = filename:join(RootDir, FileName),
@@ -1716,14 +1666,12 @@ path_consult(Config) when is_list(Config) ->
?line {ok,_,_} = ?FILE_MODULE:path_consult(["nosuch1","nosuch2"],Name),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
eval1(suite) -> [];
eval1(doc) -> [];
eval1(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(priv_dir,Config),
?line Name = filename:join(RootDir,
atom_to_list(?MODULE)++"_eval.fil"),
@@ -1753,13 +1701,11 @@ eval1(Config) when is_list(Config) ->
?line {error, enoent} = ?FILE_MODULE:eval(Name ++ ".nonexistent"),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
path_eval(suite) -> [];
path_eval(doc) -> [];
path_eval(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(priv_dir,Config),
?line FileName = atom_to_list(?MODULE)++"_path_eval.fil",
?line Name = filename:join(RootDir, FileName),
@@ -1788,14 +1734,12 @@ path_eval(Config) when is_list(Config) ->
erl_eval:add_binding('R', true, erl_eval:new_bindings())),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
script1(suite) -> [];
script1(doc) -> "";
script1(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(priv_dir,Config),
?line Name = filename:join(RootDir,
atom_to_list(?MODULE)++"_script.fil"),
@@ -1822,13 +1766,11 @@ script1(Config) when is_list(Config) ->
?line {error, enoent} = ?FILE_MODULE:script(Name ++ ".nonexistent"),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
path_script(suite) -> [];
path_script(doc) -> [];
path_script(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(priv_dir,Config),
?line FileName = atom_to_list(?MODULE)++"_path_script.fil",
?line Name = filename:join(RootDir, FileName),
@@ -1857,7 +1799,6 @@ path_script(Config) when is_list(Config) ->
erl_eval:add_binding('B', 6, erl_eval:new_bindings())),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
@@ -1865,7 +1806,6 @@ path_script(Config) when is_list(Config) ->
truncate(suite) -> [];
truncate(doc) -> [];
truncate(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(priv_dir,Config),
?line Name = filename:join(RootDir,
atom_to_list(?MODULE)
@@ -1892,14 +1832,12 @@ truncate(Config) when is_list(Config) ->
?line {error, _} = ?FILE_MODULE:truncate(Fd2),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
datasync(suite) -> [];
datasync(doc) -> "Tests that ?FILE_MODULE:datasync/1 at least doesn't crash.";
datasync(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line PrivDir = ?config(priv_dir, Config),
?line Sync = filename:join(PrivDir,
atom_to_list(?MODULE)
@@ -1916,14 +1854,12 @@ datasync(Config) when is_list(Config) ->
?line ok = ?FILE_MODULE:close(Fd2),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
sync(suite) -> [];
sync(doc) -> "Tests that ?FILE_MODULE:sync/1 at least doesn't crash.";
sync(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line PrivDir = ?config(priv_dir, Config),
?line Sync = filename:join(PrivDir,
atom_to_list(?MODULE)
@@ -1940,13 +1876,11 @@ sync(Config) when is_list(Config) ->
?line ok = ?FILE_MODULE:close(Fd2),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
advise(suite) -> [];
advise(doc) -> "Tests that ?FILE_MODULE:advise/4 at least doesn't crash.";
advise(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line PrivDir = ?config(priv_dir, Config),
?line Advise = filename:join(PrivDir,
atom_to_list(?MODULE)
@@ -2011,13 +1945,11 @@ advise(Config) when is_list(Config) ->
?line ok = ?FILE_MODULE:close(Fd9),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
allocate(suite) -> [];
allocate(doc) -> "Tests that ?FILE_MODULE:allocate/3 at least doesn't crash.";
allocate(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line PrivDir = ?config(priv_dir, Config),
?line Allocate = filename:join(PrivDir,
atom_to_list(?MODULE)
@@ -2051,7 +1983,6 @@ allocate(Config) when is_list(Config) ->
?line ok = ?FILE_MODULE:close(Fd4),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
allocate_and_assert(Fd, Offset, Length) ->
@@ -2088,7 +2019,6 @@ allocate_and_assert(Fd, Offset, Length) ->
delete(suite) -> [];
delete(doc) -> [];
delete(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(priv_dir,Config),
?line Name = filename:join(RootDir,
atom_to_list(?MODULE)
@@ -2105,13 +2035,11 @@ delete(Config) when is_list(Config) ->
%% Try deleting a nonexistent file
?line {error, enoent} = ?FILE_MODULE:delete(Name),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
rename(suite) ->[];
rename(doc) ->[];
rename(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(priv_dir,Config),
?line FileName1 = atom_to_list(?MODULE)++"_rename.fil",
?line FileName2 = atom_to_list(?MODULE)++"_rename.ful",
@@ -2159,7 +2087,6 @@ rename(Config) when is_list(Config) ->
?line io:format("Errmsg2: ~p",[Msg2]),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -2167,7 +2094,6 @@ rename(Config) when is_list(Config) ->
names(suite) -> [];
names(doc) -> [];
names(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
?line RootDir = ?config(priv_dir,Config),
?line FileName = "foo1.fil",
?line Name1 = filename:join(RootDir, FileName),
@@ -2213,7 +2139,6 @@ names(Config) when is_list(Config) ->
ok = ?FILE_MODULE:close(Fd14)
end,
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -2222,7 +2147,6 @@ names(Config) when is_list(Config) ->
e_delete(suite) -> [];
e_delete(doc) -> [];
e_delete(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
?line RootDir = ?config(priv_dir, Config),
?line Base = filename:join(RootDir,
atom_to_list(?MODULE)++"_e_delete"),
@@ -2257,7 +2181,6 @@ e_delete(Config) when is_list(Config) ->
end,
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
%%% FreeBSD gives EEXIST when renaming a file to an empty dir, although the
@@ -2268,7 +2191,6 @@ e_delete(Config) when is_list(Config) ->
e_rename(suite) -> [];
e_rename(doc) -> [];
e_rename(Config) when is_list(Config) ->
- Dog = test_server:timetrap(test_server:seconds(10)),
RootDir = ?config(priv_dir, Config),
Base = filename:join(RootDir,
atom_to_list(?MODULE)++"_e_rename"),
@@ -2358,7 +2280,6 @@ e_rename(Config) when is_list(Config) ->
ok
end,
[] = flush(),
- test_server:timetrap_cancel(Dog),
Comment.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -2366,7 +2287,6 @@ e_rename(Config) when is_list(Config) ->
e_make_dir(suite) -> [];
e_make_dir(doc) -> [];
e_make_dir(Config) when is_list(Config) ->
- Dog = test_server:timetrap(test_server:seconds(10)),
RootDir = ?config(priv_dir, Config),
Base = filename:join(RootDir,
atom_to_list(?MODULE)++"_e_make_dir"),
@@ -2394,7 +2314,6 @@ e_make_dir(Config) when is_list(Config) ->
?FILE_MODULE:write_file_info(
Base, #file_info {mode=8#600})
end,
- test_server:timetrap_cancel(Dog),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -2402,7 +2321,6 @@ e_make_dir(Config) when is_list(Config) ->
e_del_dir(suite) -> [];
e_del_dir(doc) -> [];
e_del_dir(Config) when is_list(Config) ->
- Dog = test_server:timetrap(test_server:seconds(10)),
RootDir = ?config(priv_dir, Config),
Base = test_server:temp_name(filename:join(RootDir, "e_del_dir")),
io:format("Base: ~p", [Base]),
@@ -2445,7 +2363,6 @@ e_del_dir(Config) when is_list(Config) ->
?FILE_MODULE:write_file_info( Base, #file_info {mode=8#600})
end,
[] = flush(),
- test_server:timetrap_cancel(Dog),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -2492,8 +2409,6 @@ remove_crs([], Result) ->
lists:reverse(Result).
try_read_file_list(Fd) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
-
%% Seek to the current position (nothing should happen).
?line {ok, 0} = ?FILE_MODULE:position(Fd, 0),
@@ -2534,12 +2449,9 @@ try_read_file_list(Fd) ->
?line ?FILE_MODULE:close(Fd),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
try_read_file_binary(Fd) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
-
%% Seek to the current position (nothing should happen).
?line {ok, 0} = ?FILE_MODULE:position(Fd, 0),
@@ -2576,12 +2488,9 @@ try_read_file_binary(Fd) ->
?line ?FILE_MODULE:close(Fd),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
read_cooked_tar_problem(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
-
?line Data = ?config(data_dir, Config),
?line ProblemFile = filename:join(Data, "cooked_tar_problem.tar.gz"),
?line {ok,Fd} = ?FILE_MODULE:open(ProblemFile, [read,compressed,binary]),
@@ -2594,7 +2503,6 @@ read_cooked_tar_problem(Config) when is_list(Config) ->
?line ok = file:close(Fd),
- ?line test_server:timetrap_cancel(Dog),
ok.
@@ -2603,7 +2511,6 @@ read_cooked_tar_problem(Config) when is_list(Config) ->
write_compressed(suite) -> [];
write_compressed(doc) -> [];
write_compressed(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
?line Priv = ?config(priv_dir, Config),
?line MyFile = filename:join(Priv,
atom_to_list(?MODULE)++"_test.gz"),
@@ -2656,7 +2563,6 @@ write_compressed(Config) when is_list(Config) ->
%% Done.
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -2684,7 +2590,6 @@ catenated_gzips(Config) when is_list(Config) ->
compress_errors(suite) -> [];
compress_errors(doc) -> [];
compress_errors(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
?line DataDir =
filename:dirname(
filename:join(?config(data_dir, Config), "x")),
@@ -2711,7 +2616,6 @@ compress_errors(Config) when is_list(Config) ->
?line ?FILE_MODULE:close(Fd),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -2806,7 +2710,6 @@ altname(doc) ->
altname(suite) ->
[];
altname(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
?line RootDir = ?config(priv_dir, Config),
?line NewDir = filename:join(RootDir,
"long alternative path name with spaces"),
@@ -2829,14 +2732,12 @@ altname(Config) when is_list(Config) ->
ok
end,
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
Result.
make_link(doc) -> "Test creating a hard link.";
make_link(suite) -> [];
make_link(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
?line RootDir = ?config(priv_dir, Config),
?line NewDir = filename:join(RootDir,
atom_to_list(?MODULE)
@@ -2869,7 +2770,6 @@ make_link(Config) when is_list(Config) ->
end,
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
Result.
read_link_info_for_non_link(doc) ->
@@ -2877,20 +2777,16 @@ read_link_info_for_non_link(doc) ->
"(on all platforms).";
read_link_info_for_non_link(suite) -> [];
read_link_info_for_non_link(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
-
?line {ok, #file_info{type=directory}} =
?FILE_MODULE:read_link_info("."),
{ok, #file_info{type=directory}} = ?FILE_MODULE:read_link_info(".", [raw]),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
symlinks(doc) -> "Test operations on symbolic links (for Unix).";
symlinks(suite) -> [];
symlinks(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
?line {error, _} = ?FILE_MODULE:read_link(lists:duplicate(10000,$a)),
{error, _} = ?FILE_MODULE:read_link_all(lists:duplicate(10000,$a)),
?line RootDir = ?config(priv_dir, Config),
@@ -2930,7 +2826,6 @@ symlinks(Config) when is_list(Config) ->
end,
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
Result.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -2938,7 +2833,6 @@ symlinks(Config) when is_list(Config) ->
copy(doc) -> [];
copy(suite) -> [];
copy(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
?line RootDir = ?config(priv_dir, Config),
%% Create a text file.
?line Name1 = filename:join(RootDir, atom_to_list(?MODULE)++"_copy_1.txt"),
@@ -2993,7 +2887,6 @@ copy(Config) when is_list(Config) ->
?line ok = ?FILE_MODULE:close(Handle2a),
?line ok = ?FILE_MODULE:close(Handle3a),
?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
ok.
@@ -3108,8 +3001,6 @@ delayed_write(doc) ->
["Tests the file open option {delayed_write, Size, Delay}"];
delayed_write(Config) when is_list(Config) ->
- Dog = ?t:timetrap(?t:seconds(20)),
-
RootDir = ?config(priv_dir, Config),
File = filename:join(RootDir,
atom_to_list(?MODULE)++"_delayed_write.txt"),
@@ -3223,14 +3114,12 @@ delayed_write(Config) when is_list(Config) ->
ok = ?FILE_MODULE:close(Fd5),
%%
[] = flush(),
- ?t:timetrap_cancel(Dog),
ok.
pid2name(doc) -> "Tests file:pid2name/1.";
pid2name(suite) -> [];
pid2name(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
?line RootDir = ?config(priv_dir, Config),
?line Base = test_server:temp_name(
filename:join(RootDir, "pid2name_")),
@@ -3244,8 +3133,6 @@ pid2name(Config) when is_list(Config) ->
?line test_server:sleep(1000),
?line false = is_process_alive(Pid),
?line undefined = file:pid2name(Pid),
- %%
- ?line test_server:timetrap_cancel(Dog),
ok.
@@ -3257,8 +3144,6 @@ read_ahead(doc) ->
["Tests the file open option {read_ahead, Size}"];
read_ahead(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(20)),
- %%
?line RootDir = ?config(priv_dir, Config),
?line File = filename:join(RootDir,
atom_to_list(?MODULE)++"_read_ahead.txt"),
@@ -3309,7 +3194,6 @@ read_ahead(Config) when is_list(Config) ->
?line ok = ?FILE_MODULE:close(Fd5),
%%
?line [] = flush(),
- ?line ?t:timetrap_cancel(Dog),
ok.
@@ -3323,8 +3207,6 @@ segment_read(suite) ->
segment_read(doc) ->
["Tests the segmenting of large reads"];
segment_read(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(60)),
- %%
?line Name = filename:join(?config(priv_dir, Config),
?MODULE_STRING ++ "_segment_read"),
?line SegSize = 256*1024,
@@ -3448,7 +3330,6 @@ segment_read(Config) when is_list(Config) ->
?line ok = ?FILE_MODULE:close(FD5),
%%
?line [] = flush(),
- ?line ?t:timetrap_cancel(Dog),
{comment, Comment}.
@@ -3462,8 +3343,6 @@ segment_write(suite) ->
segment_write(doc) ->
["Tests the segmenting of large writes"];
segment_write(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(60)),
- %%
?line Name = filename:join(?config(priv_dir, Config),
?MODULE_STRING ++ "_segment_write"),
?line SegSize = 256*1024,
@@ -3642,7 +3521,6 @@ segment_write(Config) when is_list(Config) ->
?line ok = ?FILE_MODULE:close(FD7),
%%
?line [] = flush(),
- ?line ?t:timetrap_cancel(Dog),
{comment, Comment}.
@@ -3653,8 +3531,6 @@ ipread(suite) ->
ipread(doc) ->
["Test Dets special indirect pread"];
ipread(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(30)),
- %%
?line Dir = ?config(priv_dir, Config),
?line ok = ipread_int(Dir, [raw, binary]),
?line ok = ipread_int(Dir, [raw]),
@@ -3664,7 +3540,6 @@ ipread(Config) when is_list(Config) ->
?line ok = ipread_int(Dir, [ram]),
%%
?line [] = flush(),
- ?line ?t:timetrap_cancel(Dog),
ok.
ipread_int(Dir, ModeList) ->
@@ -3753,8 +3628,6 @@ interleaved_read_write(suite) ->
interleaved_read_write(doc) ->
["Tests interleaved read and writes"];
interleaved_read_write(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(30)),
- %%
?line Dir = ?config(priv_dir, Config),
?line File =
filename:join(Dir, ?MODULE_STRING++"interleaved_read_write.txt"),
@@ -3775,7 +3648,6 @@ interleaved_read_write(Config) when is_list(Config) ->
?line ok = ?FILE_MODULE:close(F2),
%%
?line [] = flush(),
- ?line ?t:timetrap_cancel(Dog),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -3785,7 +3657,6 @@ otp_5814(suite) ->
otp_5814(doc) ->
["OTP-5814. eval/consult/script return correct line numbers"];
otp_5814(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(10)),
PrivDir = ?config(priv_dir, Config),
File = filename:join(PrivDir, "otp_5814"),
Path = [PrivDir],
@@ -3815,7 +3686,6 @@ otp_5814(Config) when is_list(Config) ->
?line {error, {1, file, {throw, apa, _}}} = file:eval(File),
file:delete(File),
- ?line ?t:timetrap_cancel(Dog),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -3867,6 +3737,9 @@ rpc_call(N, F, As) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+large_file() ->
+ [{timetrap,{minutes,20}}].
+
large_file(suite) ->
[];
large_file(doc) ->
@@ -3877,8 +3750,6 @@ large_file(Config) when is_list(Config) ->
"_large_file").
do_large_file(Name) ->
- ?line Watchdog = ?t:timetrap(?t:minutes(20)),
-
?line S = "1234567890",
L = length(S),
R = lists:reverse(S),
@@ -3913,8 +3784,7 @@ do_large_file(Name) ->
?line {ok,PL} = ?FILE_MODULE:position(F1, {eof,-L}),
?line {ok,R} = ?FILE_MODULE:read(F1, L+1),
?line ok = ?FILE_MODULE:close(F1),
- %%
- ?line ?t:timetrap_cancel(Watchdog),
+
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/lib/kernel/test/file_name_SUITE.erl b/lib/kernel/test/file_name_SUITE.erl
index e6f8761f95..e4b5b88f00 100644
--- a/lib/kernel/test/file_name_SUITE.erl
+++ b/lib/kernel/test/file_name_SUITE.erl
@@ -79,14 +79,14 @@
init_per_testcase(_Func, Config) ->
- Dog = test_server:timetrap(test_server:seconds(60)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Func, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
+end_per_testcase(_Func, _Config) ->
+ ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[normal, icky, very_icky, normalize, home_dir].
diff --git a/lib/kernel/test/gen_sctp_SUITE.erl b/lib/kernel/test/gen_sctp_SUITE.erl
index 99f8625ba9..11ffdb003e 100644
--- a/lib/kernel/test/gen_sctp_SUITE.erl
+++ b/lib/kernel/test/gen_sctp_SUITE.erl
@@ -42,7 +42,9 @@
names_unihoming_ipv4/1, names_unihoming_ipv6/1,
names_multihoming_ipv4/1, names_multihoming_ipv6/1]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[basic, api_open_close, api_listen, api_connect_init,
@@ -81,12 +83,10 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Func, Config) ->
- Dog = test_server:timetrap(test_server:seconds(15)),
- [{watchdog, Dog}|Config].
-end_per_testcase(_Func, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
+ Config.
+end_per_testcase(_Func, _Config) ->
+ ok.
-define(LOGVAR(Var), begin io:format(??Var" = ~p~n", [Var]) end).
diff --git a/lib/kernel/test/gen_tcp_api_SUITE.erl b/lib/kernel/test/gen_tcp_api_SUITE.erl
index 962471c20c..90435a4221 100644
--- a/lib/kernel/test/gen_tcp_api_SUITE.erl
+++ b/lib/kernel/test/gen_tcp_api_SUITE.erl
@@ -38,7 +38,9 @@
-export([getsockfd/0,closesockfd/1]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[{group, t_accept}, {group, t_connect}, {group, t_recv},
@@ -65,11 +67,10 @@ end_per_group(_,_Config) ->
ok.
init_per_testcase(_Func, Config) ->
- Dog = test_server:timetrap(test_server:seconds(60)),
- [{watchdog, Dog}|Config].
-end_per_testcase(_Func, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
+ Config.
+
+end_per_testcase(_Func, _Config) ->
+ ok.
%%% gen_tcp:accept/1,2
diff --git a/lib/kernel/test/gen_tcp_echo_SUITE.erl b/lib/kernel/test/gen_tcp_echo_SUITE.erl
index fe81cbac18..99c3ecf3b1 100644
--- a/lib/kernel/test/gen_tcp_echo_SUITE.erl
+++ b/lib/kernel/test/gen_tcp_echo_SUITE.erl
@@ -34,7 +34,9 @@
-define(TPKT_VRSN, 3).
-define(LINE_LENGTH, 1023). % (default value of gen_tcp option 'recbuf') - 1
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,5}}].
all() ->
[active_echo, passive_echo, active_once_echo,
@@ -59,11 +61,10 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Func, Config) ->
- Dog = test_server:timetrap(test_server:minutes(5)),
- [{watchdog, Dog}|Config].
-end_per_testcase(_Func, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
+ Config.
+
+end_per_testcase(_Func, _Config) ->
+ ok.
active_echo(doc) ->
["Test sending packets of various sizes and various packet types ",
diff --git a/lib/kernel/test/gen_tcp_misc_SUITE.erl b/lib/kernel/test/gen_tcp_misc_SUITE.erl
index 323796665b..904546d567 100644
--- a/lib/kernel/test/gen_tcp_misc_SUITE.erl
+++ b/lib/kernel/test/gen_tcp_misc_SUITE.erl
@@ -27,7 +27,9 @@
init_per_group/2,end_per_group/2,
controlling_process/1, controlling_process_self/1,
no_accept/1, close_with_pending_output/1, active_n/1,
- data_before_close/1, iter_max_socks/1, get_status/1,
+ data_before_close/1,
+ iter_max_socks/0, iter_max_socks/1,
+ get_status/1,
passive_sockets/1, accept_closed_by_other_process/1,
init_per_testcase/2, end_per_testcase/2,
otp_3924/1, otp_3924_sender/4, closed_socket/1,
@@ -50,7 +52,8 @@
killing_acceptor/1,killing_multi_acceptors/1,killing_multi_acceptors2/1,
several_accepts_in_one_go/1, accept_system_limit/1,
active_once_closed/1, send_timeout/1, send_timeout_active/1,
- otp_7731/1, zombie_sockets/1, otp_7816/1, otp_8102/1, wrapping_oct/1,
+ otp_7731/1, zombie_sockets/1, otp_7816/1, otp_8102/1,
+ wrapping_oct/0, wrapping_oct/1,
otp_9389/1]).
%% Internal exports.
@@ -58,25 +61,15 @@
oct_acceptor/1,
otp_7731_server/1, zombie_server/2, do_iter_max_socks/2]).
-init_per_testcase(iter_max_socks, Config) when is_list(Config) ->
- Dog = case os:type() of
- {win32,_} ->
- test_server:timetrap(test_server:minutes(30));
- _Else ->
- test_server:timetrap(test_server:seconds(240))
- end,
- [{watchdog, Dog}|Config];
-init_per_testcase(wrapping_oct, Config) when is_list(Config) ->
- Dog = test_server:timetrap(test_server:seconds(600)),
- [{watchdog, Dog}|Config];
-init_per_testcase(_Func, Config) when is_list(Config) ->
- Dog = test_server:timetrap(test_server:seconds(240)),
- [{watchdog, Dog}|Config].
-end_per_testcase(_Func, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
-
-suite() -> [{ct_hooks,[ts_install_cth]}].
+init_per_testcase(_Func, Config) ->
+ Config.
+
+end_per_testcase(_Func, _Config) ->
+ ok.
+
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,4}}].
all() ->
[controlling_process, controlling_process_self, no_accept,
@@ -710,6 +703,9 @@ get_status(Config) when is_list(Config) ->
-define(RECOVER_SLEEP, 60000).
-define(RETRY_SLEEP, 15000).
+iter_max_socks() ->
+ [{timetrap,{minutes,30}}].
+
iter_max_socks(doc) ->
["Open as many sockets as possible. Do this several times and check ",
"that we get the same number of sockets every time."];
@@ -2495,7 +2491,6 @@ send_timeout_active(suite) ->
send_timeout_active(doc) ->
["Test the send_timeout socket option for active sockets"];
send_timeout_active(Config) when is_list(Config) ->
- Dog = test_server:timetrap(test_server:seconds(20)),
%% Basic
BasicFun =
fun(AutoClose) ->
@@ -2523,7 +2518,6 @@ send_timeout_active(Config) when is_list(Config) ->
flush(),
BasicFun(true),
flush(),
- test_server:timetrap_cancel(Dog),
ok.
after_send_timeout(AutoClose) ->
@@ -3048,6 +3042,9 @@ otp_9389_loop(S, OrigLinkHdr, State) ->
error({timeout,header})
end.
+wrapping_oct() ->
+ [{timetrap,{minutes,10}}].
+
wrapping_oct(doc) ->
"Check that 64bit octet counters work.";
wrapping_oct(suite) ->
diff --git a/lib/kernel/test/gen_udp_SUITE.erl b/lib/kernel/test/gen_udp_SUITE.erl
index 2efbf26e1c..0e054b9135 100644
--- a/lib/kernel/test/gen_udp_SUITE.erl
+++ b/lib/kernel/test/gen_udp_SUITE.erl
@@ -25,8 +25,6 @@
-include_lib("common_test/include/ct.hrl").
--define(default_timeout, ?t:minutes(1)).
-
% XXX - we should pick a port that we _know_ is closed. That's pretty hard.
-define(CLOSED_PORT, 6666).
@@ -38,7 +36,9 @@
buffer_size/1, binary_passive_recv/1, bad_address/1,
read_packets/1, open_fd/1, connect/1, implicit_inet6/1]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[send_to_closed, buffer_size, binary_passive_recv,
@@ -62,12 +62,9 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
- ?line Dog=test_server:timetrap(?default_timeout),
- [{watchdog, Dog}|Config].
+ Config.
end_per_testcase(_Case, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
ok.
%%-------------------------------------------------------------
diff --git a/lib/kernel/test/global_SUITE.erl b/lib/kernel/test/global_SUITE.erl
index 0046fdafa4..7619ad8d64 100644
--- a/lib/kernel/test/global_SUITE.erl
+++ b/lib/kernel/test/global_SUITE.erl
@@ -61,7 +61,8 @@
-define(GLOBAL_LOCK, global).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]}].
all() ->
case init:get_argument(ring_line) of
diff --git a/lib/kernel/test/global_group_SUITE.erl b/lib/kernel/test/global_group_SUITE.erl
index e7d321418c..410ade37e6 100644
--- a/lib/kernel/test/global_group_SUITE.erl
+++ b/lib/kernel/test/global_group_SUITE.erl
@@ -36,7 +36,9 @@
-define(UNTIL(Seq), loop_until_true(fun() -> Seq end)).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,5}}].
all() ->
[start_gg_proc, no_gg_proc, no_gg_proc_sync, compatible,
@@ -79,13 +81,11 @@ end_per_suite(_Config) ->
-define(TESTCASE, testcase_name).
-define(testcase, ?config(?TESTCASE, Config)).
-init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) ->
- Dog=?t:timetrap(?t:minutes(5)),
- [{?TESTCASE, Case}, {watchdog, Dog}|Config].
+init_per_testcase(Case, Config) ->
+ Config.
-end_per_testcase(_Func, Config) ->
- Dog=?config(watchdog, Config),
- ?t:timetrap_cancel(Dog).
+end_per_testcase(_Func, _Config) ->
+ ok.
%%-----------------------------------------------------------------
%% Test suites for global groups.
@@ -97,8 +97,6 @@ end_per_testcase(_Func, Config) ->
start_gg_proc(suite) -> [];
start_gg_proc(doc) -> ["Check that the global_group processes are started automatically. "];
start_gg_proc(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(120)),
-
?line Dir = ?config(priv_dir, Config),
?line File = filename:join(Dir, "global_group.config"),
?line {ok, Fd}=file:open(File, [write]),
@@ -123,7 +121,6 @@ start_gg_proc(Config) when is_list(Config) ->
stop_node(Cp3),
?line ?UNTIL(undefined =:= global:whereis_name(test)),
- ?line test_server:timetrap_cancel(Dog),
ok.
@@ -132,8 +129,6 @@ no_gg_proc(suite) -> [];
no_gg_proc(doc) -> ["Start a system without global groups. Nodes are not "
"synced at start (sync_nodes_optional is not defined)"];
no_gg_proc(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(200)),
-
?line Dir = ?config(priv_dir, Config),
?line File = filename:join(Dir, "no_global_group.config"),
?line {ok, Fd} = file:open(File, [write]),
@@ -294,7 +289,6 @@ no_gg_proc(Config) when is_list(Config) ->
stop_node(Cpz),
?line ?UNTIL(undefined =:= global:whereis_name(test)),
- ?line test_server:timetrap_cancel(Dog),
ok.
@@ -305,8 +299,6 @@ no_gg_proc_sync(doc) ->
["Start a system without global groups, but syncing the nodes by using "
"sync_nodes_optional."];
no_gg_proc_sync(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(200)),
-
?line Dir = ?config(priv_dir, Config),
?line File = filename:join(Dir, "no_global_group_sync.config"),
?line {ok, Fd} = file:open(File, [write]),
@@ -469,7 +461,6 @@ no_gg_proc_sync(Config) when is_list(Config) ->
stop_node(Cpz),
?line ?UNTIL(undefined =:= global:whereis_name(test)),
- ?line test_server:timetrap_cancel(Dog),
ok.
@@ -479,8 +470,6 @@ compatible(suite) -> [];
compatible(doc) ->
["Check that a system without global groups is compatible with the old R4 system."];
compatible(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(200)),
-
?line Dir = ?config(priv_dir, Config),
?line File = filename:join(Dir, "global_group_comp.config"),
?line {ok, Fd} = file:open(File, [write]),
@@ -643,7 +632,6 @@ compatible(Config) when is_list(Config) ->
stop_node(Cpz),
?line ?UNTIL(undefined =:= global:whereis_name(test)),
- ?line test_server:timetrap_cancel(Dog),
ok.
@@ -652,8 +640,6 @@ compatible(Config) when is_list(Config) ->
one_grp(suite) -> [];
one_grp(doc) -> ["Test a system with only one global group. "];
one_grp(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(120)),
-
?line Dir = ?config(priv_dir, Config),
?line File = filename:join(Dir, "global_group.config"),
?line {ok, Fd} = file:open(File, [write]),
@@ -728,7 +714,6 @@ one_grp(Config) when is_list(Config) ->
stop_node(Cp1),
stop_node(Cp2),
- ?line test_server:timetrap_cancel(Dog),
ok.
@@ -739,8 +724,6 @@ one_grp_x(suite) -> [];
one_grp_x(doc) -> ["Check a system with only one global group. "
"Start the nodes with different time intervals. "];
one_grp_x(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(120)),
-
?line Dir = ?config(priv_dir, Config),
?line File = filename:join(Dir, "global_group.config"),
?line {ok, Fd} = file:open(File, [write]),
@@ -790,7 +773,6 @@ one_grp_x(Config) when is_list(Config) ->
stop_node(Cp2),
stop_node(Cp3),
- ?line test_server:timetrap_cancel(Dog),
ok.
@@ -801,8 +783,6 @@ one_grp_x(Config) when is_list(Config) ->
two_grp(suite) -> [];
two_grp(doc) -> ["Test a two global group system. "];
two_grp(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(200)),
-
?line Dir = ?config(priv_dir, Config),
?line File = filename:join(Dir, "global_group.config"),
?line {ok, Fd} = file:open(File, [write]),
@@ -1093,7 +1073,6 @@ two_grp(Config) when is_list(Config) ->
stop_node(Cpy),
stop_node(Cpz),
- ?line test_server:timetrap_cancel(Dog),
ok.
@@ -1101,8 +1080,6 @@ two_grp(Config) when is_list(Config) ->
hidden_groups(suite) -> [];
hidden_groups(doc) -> ["Test hidden global groups."];
hidden_groups(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(200)),
-
?line Dir = ?config(priv_dir, Config),
?line File = filename:join(Dir, "global_group.config"),
?line {ok, Fd} = file:open(File, [write]),
@@ -1169,15 +1146,12 @@ hidden_groups(Config) when is_list(Config) ->
stop_node(Cpz),
stop_node(Cpq),
- ?line test_server:timetrap_cancel(Dog),
ok.
test_exit(suite) -> [];
test_exit(doc) -> ["Checks when the search process exits. "];
test_exit(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(120)),
-
?line NN = node_name(atom_to_list(node())),
?line Cp1nn = list_to_atom("cp1@" ++ NN),
@@ -1201,7 +1175,6 @@ test_exit(Config) when is_list(Config) ->
% sleep to let the nodes die
test_server:sleep(1000),
- ?line test_server:timetrap_cancel(Dog),
ok.
diff --git a/lib/kernel/test/heart_SUITE.erl b/lib/kernel/test/heart_SUITE.erl
index eb6cb06622..9a36b6efe7 100644
--- a/lib/kernel/test/heart_SUITE.erl
+++ b/lib/kernel/test/heart_SUITE.erl
@@ -38,10 +38,9 @@
-define(DEFAULT_TIMEOUT_SECS, 120).
init_per_testcase(_Func, Config) ->
- Dog=test_server:timetrap(test_server:seconds(?DEFAULT_TIMEOUT_SECS)),
- [{watchdog, Dog}|Config].
+ Config.
-end_per_testcase(_Func, Config) ->
+end_per_testcase(_Func, _Config) ->
Nodes = nodes(),
lists:foreach(fun(X) ->
NNam = list_to_atom(hd(string:tokens(atom_to_list(X),"@"))),
@@ -52,16 +51,16 @@ end_per_testcase(_Func, Config) ->
_ ->
ok
end
- end, Nodes),
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
+ end, Nodes).
%%-----------------------------------------------------------------
%% Test suite for heart.
%% Should be started in a CC view with:
%% erl -sname master -rsh ctrsh
%%-----------------------------------------------------------------
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,2}}].
all() -> [
start, restart, reboot,
diff --git a/lib/kernel/test/inet_SUITE.erl b/lib/kernel/test/inet_SUITE.erl
index 0a36bc9673..fe29521761 100644
--- a/lib/kernel/test/inet_SUITE.erl
+++ b/lib/kernel/test/inet_SUITE.erl
@@ -46,7 +46,9 @@
kill_gethost/0, parallell_gethost/0, test_netns/0]).
-export([init_per_testcase/2, end_per_testcase/2]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[t_gethostbyaddr, t_gethostbyname, t_getaddr,
@@ -98,24 +100,19 @@ init_per_testcase(lookup_bad_search_option, Config) ->
ets:delete(Db, Key),
ets:insert(Db, {Key,[lookup_bad_search_option]}),
?t:format("Misconfigured resolver lookup order", []),
- Dog = test_server:timetrap(test_server:seconds(60)),
- [{Key,Prev},{watchdog,Dog}|Config];
+ [{Key,Prev}|Config];
init_per_testcase(_Func, Config) ->
- Dog = test_server:timetrap(test_server:seconds(60)),
- [{watchdog,Dog}|Config].
+ Config.
end_per_testcase(lookup_bad_search_option, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
Db = inet_db,
Key = res_lookup,
Prev = ?config(Key, Config),
ets:delete(Db, Key),
ets:insert(Db, Prev),
?t:format("Restored resolver lookup order", []);
-end_per_testcase(_Func, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
+end_per_testcase(_Func, _Config) ->
+ ok.
t_gethostbyaddr() ->
required(v4).
@@ -376,15 +373,14 @@ ipv4_to_ipv6(Config) when is_list(Config) ->
end,
ok.
-host_and_addr() -> required(hosts).
+host_and_addr() ->
+ [{timetrap,{minutes,5}}|required(hosts)].
+
host_and_addr(doc) -> ["Test looking up hosts and addresses. Use 'ypcat hosts' ",
"or the local eqivalent to find all hosts."];
host_and_addr(suite) -> [];
host_and_addr(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:minutes(5)),
-
?line lists:foreach(fun try_host/1, get_hosts(Config)),
- ?line test_server:timetrap_cancel(Dog),
ok.
try_host({Ip0, Host}) ->
diff --git a/lib/kernel/test/inet_res_SUITE.erl b/lib/kernel/test/inet_res_SUITE.erl
index ea06061c74..d91e575aaa 100644
--- a/lib/kernel/test/inet_res_SUITE.erl
+++ b/lib/kernel/test/inet_res_SUITE.erl
@@ -42,7 +42,9 @@
-define(RUN_NAMED, "run-named").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[basic, resolve, edns0, txt_record, files_monitor,
@@ -88,15 +90,13 @@ init_per_testcase(Func, Config) ->
inet_db:ins_alt_ns(IP, Port);
_ -> ok
end,
- Dog = test_server:timetrap(test_server:seconds(20)),
- [{nameserver,NsSpec},{res_lookup,Lookup},{watchdog,Dog}|Config]
+ [{nameserver,NsSpec},{res_lookup,Lookup}|Config]
catch
SkipReason ->
{skip,SkipReason}
end.
end_per_testcase(_Func, Config) ->
- test_server:timetrap_cancel(?config(watchdog, Config)),
inet_db:set_lookup(?config(res_lookup, Config)),
NsSpec = ?config(nameserver, Config),
case NsSpec of
diff --git a/lib/kernel/test/inet_sockopt_SUITE.erl b/lib/kernel/test/inet_sockopt_SUITE.erl
index a6981854c8..bf815fef1e 100644
--- a/lib/kernel/test/inet_sockopt_SUITE.erl
+++ b/lib/kernel/test/inet_sockopt_SUITE.erl
@@ -62,7 +62,9 @@
-export([init_per_testcase/2, end_per_testcase/2]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[simple, loop_all, simple_raw, simple_raw_getbin,
@@ -90,12 +92,10 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Func, Config) ->
- Dog = test_server:timetrap(test_server:seconds(60)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Func, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
+end_per_testcase(_Func, _Config) ->
+ ok.
simple(suite) -> [];
simple(doc) -> "Test inet:setopt/getopt simple functionality.";
diff --git a/lib/kernel/test/init_SUITE.erl b/lib/kernel/test/init_SUITE.erl
index cb531f7b57..4613cce49f 100644
--- a/lib/kernel/test/init_SUITE.erl
+++ b/lib/kernel/test/init_SUITE.erl
@@ -25,7 +25,7 @@
init_per_group/2,end_per_group/2]).
-export([get_arguments/1, get_argument/1, boot_var/1, restart/1,
- many_restarts/1,
+ many_restarts/0, many_restarts/1,
get_plain_arguments/1,
reboot/1, stop/1, get_status/1, script_id/1]).
-export([boot1/1, boot2/1]).
@@ -41,7 +41,9 @@
%% Should be started in a CC view with:
%% erl -sname master -rsh ctrsh
%%-----------------------------------------------------------------
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,2}}].
all() ->
[get_arguments, get_argument, boot_var,
@@ -65,13 +67,11 @@ end_per_group(_GroupName, Config) ->
Config.
-init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) ->
- Dog=?t:timetrap(?t:seconds(?DEFAULT_TIMEOUT_SEC)),
- [{watchdog, Dog}|Config].
+init_per_testcase(Func, Config) ->
+ Config.
-end_per_testcase(_Func, Config) ->
- Dog=?config(watchdog, Config),
- ?t:timetrap_cancel(Dog).
+end_per_testcase(_Func, _Config) ->
+ ok.
init(doc) -> [];
init(suite) -> [];
@@ -89,8 +89,6 @@ fini(Config) when is_list(Config) ->
get_arguments(doc) ->[];
get_arguments(suite) -> {req, [distribution, {local_slave_nodes, 1}]};
get_arguments(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(10)),
-
Args = args(),
?line {ok, Node} = start_node(init_test, Args),
?line case rpc:call(Node, init, get_arguments, []) of
@@ -104,7 +102,6 @@ get_arguments(Config) when is_list(Config) ->
stop_node(Node),
?t:fail(get_arguments)
end,
- ?line ?t:timetrap_cancel(Dog),
ok.
check_a(Args) ->
@@ -178,8 +175,6 @@ check_d(Args) ->
get_argument(doc) ->[];
get_argument(suite) -> {req, [distribution, {local_slave_nodes, 1}]};
get_argument(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(10)),
-
Args = args(),
?line {ok, Node} = start_node(init_test, Args),
?line case rpc:call(Node, init, get_argument, [b]) of
@@ -218,13 +213,11 @@ get_argument(Config) when is_list(Config) ->
?t:fail({get_argument, e})
end,
stop_node(Node),
- ?line ?t:timetrap_cancel(Dog),
ok.
get_plain_arguments(doc) ->[];
get_plain_arguments(suite) -> {req, [distribution, {local_slave_nodes, 1}]};
get_plain_arguments(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(10)),
Longstring =
"fjdkfjdkfjfdaa2fjdkfjdkfjfdaa2fjdkfjdkfjfdaa2"
"fjdkfjdkfjfdaa2fjdkfjdkfjfdaa2fjdkfjdkfjfdaa2"
@@ -246,7 +239,6 @@ get_plain_arguments(Config) when is_list(Config) ->
?t:fail({get_argument, As})
end,
stop_node(Node),
- ?line ?t:timetrap_cancel(Dog),
ok.
@@ -257,8 +249,6 @@ get_plain_arguments(Config) when is_list(Config) ->
boot_var(doc) -> [];
boot_var(suite) -> {req, [distribution, {local_slave_nodes, 1}]};
boot_var(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(100)),
-
{BootScript, TEST_VAR, KernelVsn, StdlibVsn} = create_boot(Config),
%% Should fail as we have not given -boot_var TEST_VAR
@@ -291,7 +281,6 @@ boot_var(Config) when is_list(Config) ->
"in a clearcase view or in a source tree. "
"Need an installed system to complete this test."}
end,
- ?line ?t:timetrap_cancel(Dog),
Res.
create_boot(Config) ->
@@ -315,6 +304,9 @@ is_real_system(KernelVsn, StdlibVsn) ->
%% Therefore the slave process must be killed
%% before restart.
%% ------------------------------------------------
+many_restarts() ->
+ [{timetrap,{minutes,8}}].
+
many_restarts(doc) -> [];
many_restarts(suite) ->
case ?t:os_type() of
@@ -325,11 +317,9 @@ many_restarts(suite) ->
end;
many_restarts(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(480)),
?line {ok, Node} = loose_node:start(init_test, "", ?DEFAULT_TIMEOUT_SEC),
?line loop_restart(30,Node,rpc:call(Node,erlang,whereis,[error_logger])),
?line loose_node:stop(Node),
- ?line ?t:timetrap_cancel(Dog),
ok.
loop_restart(0,_,_) ->
@@ -391,7 +381,6 @@ restart(suite) ->
{skip, "Only run on unix and win32"}
end;
restart(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(40)),
?line Args = args(),
%% Currently test_server:start_node cannot be used. The restarted
@@ -443,7 +432,6 @@ restart(Config) when is_list(Config) ->
?t:fail({get_argument, restart_fail})
end,
loose_node:stop(Node),
- ?line ?t:timetrap_cancel(Dog),
ok.
wait_restart(0, _Node) ->
@@ -483,8 +471,6 @@ apid(Pid) ->
reboot(doc) -> [];
reboot(suite) -> {req, [distribution, {local_slave_nodes, 1}]};
reboot(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(40)),
-
Args = args(),
?line {ok, Node} = start_node(init_test, Args),
erlang:monitor_node(Node, true),
@@ -504,7 +490,6 @@ reboot(Config) when is_list(Config) ->
stop_node(Node),
?t:fail(system_rebooted)
end,
- ?line ?t:timetrap_cancel(Dog),
ok.
%% ------------------------------------------------
@@ -513,7 +498,6 @@ reboot(Config) when is_list(Config) ->
stop(doc) -> [];
stop(suite) -> [];
stop(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(20)),
Args = args(),
?line {ok, Node} = start_node(init_test, Args),
erlang:monitor_node(Node, true),
@@ -533,7 +517,6 @@ stop(Config) when is_list(Config) ->
stop_node(Node),
?t:fail(system_rebooted)
end,
- ?line ?t:timetrap_cancel(Dog),
ok.
%% ------------------------------------------------
@@ -542,10 +525,8 @@ stop(Config) when is_list(Config) ->
get_status(doc) -> [];
get_status(suite) -> [];
get_status(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(10)),
- ?line ?t:timetrap_cancel(Dog),
-
?line {Start, _} = init:get_status(),
+
%% Depending on how the test_server is started Start has
%% different values. staring if test_server started with
%% -s flag.
@@ -562,8 +543,6 @@ get_status(Config) when is_list(Config) ->
script_id(doc) -> [];
script_id(suite) -> [];
script_id(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(10)),
-
?line {Name, Vsn} = init:script_id(),
?line if
is_list(Name), is_list(Vsn) ->
@@ -571,7 +550,6 @@ script_id(Config) when is_list(Config) ->
true ->
?t:fail(not_standard_script)
end,
- ?line ?t:timetrap_cancel(Dog),
ok.
%% ------------------------------------------------
@@ -581,7 +559,6 @@ script_id(Config) when is_list(Config) ->
boot1(doc) -> [];
boot1(suite) -> {req, [distribution, {local_slave_nodes, 1}, {time, 35}]};
boot1(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(80)),
Args = args() ++ " -boot start_sasl",
?line {ok, Node} = start_node(init_test, Args),
?line stop_node(Node),
@@ -590,14 +567,11 @@ boot1(Config) when is_list(Config) ->
Args1 = args() ++ " -boot dummy_script",
?line {error, timeout} = start_node(init_test, Args1),
- ?line ?t:timetrap_cancel(Dog),
ok.
boot2(doc) -> [];
boot2(suite) -> {req, [distribution, {local_slave_nodes, 1}, {time, 35}]};
boot2(Config) when is_list(Config) ->
- Dog = ?t:timetrap(?t:seconds(80)),
-
%% Absolute boot file name
Boot = filename:join([code:root_dir(), "bin", "start_sasl"]),
@@ -620,7 +594,6 @@ boot2(Config) when is_list(Config) ->
ok
end,
- ?t:timetrap_cancel(Dog),
ok.
%% Misc. functions
diff --git a/lib/kernel/test/interactive_shell_SUITE.erl b/lib/kernel/test/interactive_shell_SUITE.erl
index d7fa52b721..a6cae02dac 100644
--- a/lib/kernel/test/interactive_shell_SUITE.erl
+++ b/lib/kernel/test/interactive_shell_SUITE.erl
@@ -30,15 +30,14 @@
-export([toerl_server/3]).
init_per_testcase(_Func, Config) ->
- Dog = test_server:timetrap(test_server:minutes(3)),
- [{watchdog,Dog}|Config].
-
-end_per_testcase(_Func, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
+ Config.
+end_per_testcase(_Func, _Config) ->
+ ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,3}}].
all() ->
[get_columns_and_rows, exit_initial, job_control_local,
diff --git a/lib/kernel/test/kernel_SUITE.erl b/lib/kernel/test/kernel_SUITE.erl
index 64c7ce6136..f95638e192 100644
--- a/lib/kernel/test/kernel_SUITE.erl
+++ b/lib/kernel/test/kernel_SUITE.erl
@@ -32,10 +32,9 @@
% Test cases must be exported.
-export([app_test/1, appup_test/1]).
-%%
-%% all/1
-%%
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,2}}].
all() ->
[app_test, appup_test].
diff --git a/lib/kernel/test/kernel_config_SUITE.erl b/lib/kernel/test/kernel_config_SUITE.erl
index 1486619b1c..761b6816c9 100644
--- a/lib/kernel/test/kernel_config_SUITE.erl
+++ b/lib/kernel/test/kernel_config_SUITE.erl
@@ -25,7 +25,9 @@
-export([init_per_suite/1, end_per_suite/1]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,2}}].
all() ->
[sync].
@@ -70,7 +72,6 @@ from(_, []) -> [].
sync(doc) -> [];
sync(suite) -> [];
sync(Conf) when is_list(Conf) ->
- ?line Dog = ?t:timetrap(?t:seconds(120)),
% Write a config file
Dir = ?config(priv_dir,Conf),
{ok, Fd} = file:open(Dir ++ "sys.config", [write]),
@@ -102,7 +103,6 @@ sync(Conf) when is_list(Conf) ->
TT-T1 < 15000 -> ?line ?t:fail({too_short_time, TT-T1});
true -> ok
end,
- ?line ?t:timetrap_cancel(Dog),
ok.
wait_for_node(Node) ->
diff --git a/lib/kernel/test/multi_load_SUITE.erl b/lib/kernel/test/multi_load_SUITE.erl
index bb87443e36..7ec4803114 100644
--- a/lib/kernel/test/multi_load_SUITE.erl
+++ b/lib/kernel/test/multi_load_SUITE.erl
@@ -28,7 +28,9 @@
-include_lib("common_test/include/ct.hrl").
-include_lib("syntax_tools/include/merl.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[basic_atomic_load,basic_errors,sticky_dir,on_load_failing,
diff --git a/lib/kernel/test/os_SUITE.erl b/lib/kernel/test/os_SUITE.erl
index 29fc3a2ea5..8fd7f0dc3f 100644
--- a/lib/kernel/test/os_SUITE.erl
+++ b/lib/kernel/test/os_SUITE.erl
@@ -28,7 +28,9 @@
-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[space_in_cwd, quoting, cmd_unicode, space_in_name, bad_command,
@@ -252,13 +254,11 @@ unix_comment_in_command(doc) ->
"OTP-1805: Test that os:cmd(\"ls #\") works correctly (used to hang).";
unix_comment_in_command(suite) -> [];
unix_comment_in_command(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(20)),
?line Priv = ?config(priv_dir, Config),
?line ok = file:set_cwd(Priv),
?line _ = os:cmd("ls #"), % Any result is ok.
?t:sleep(5),
?line [] = receive_all(),
- ?line test_server:timetrap_cancel(Dog),
ok.
deep_list_command(doc) ->
diff --git a/lib/kernel/test/pdict_SUITE.erl b/lib/kernel/test/pdict_SUITE.erl
index 80025d2fd9..7e24b7b8ac 100644
--- a/lib/kernel/test/pdict_SUITE.erl
+++ b/lib/kernel/test/pdict_SUITE.erl
@@ -38,14 +38,14 @@
-export([other_process/2]).
init_per_testcase(_Case, Config) ->
- ?line Dog = ?t:timetrap(test_server:minutes(10)),
- [{watchdog, Dog} | Config].
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+ Config.
+
+end_per_testcase(_Case, _Config) ->
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[simple, complicated, heavy, simple_all_keys, info,
diff --git a/lib/kernel/test/pg2_SUITE.erl b/lib/kernel/test/pg2_SUITE.erl
index 6e4f5ee682..0f143770bc 100644
--- a/lib/kernel/test/pg2_SUITE.erl
+++ b/lib/kernel/test/pg2_SUITE.erl
@@ -33,9 +33,6 @@
otp_7277/1, otp_8259/1, otp_8653/1,
compat/1, basic/1]).
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(1)).
-
-define(TESTCASE, testcase_name).
-define(testcase, ?config(?TESTCASE, Config)).
@@ -44,16 +41,15 @@
mk_part_node/3, part1/5, p_init/3, start_proc/1, sane/0]).
init_per_testcase(Case, Config) ->
- ?line Dog = ?t:timetrap(?default_timeout),
- [{?TESTCASE, Case}, {watchdog, Dog} | Config].
+ [{?TESTCASE, Case}| Config].
end_per_testcase(_Case, _Config) ->
test_server_ctrl:kill_slavenodes(),
- Dog = ?config(watchdog, _Config),
- test_server:timetrap_cancel(Dog),
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[{group, tickets}].
@@ -105,9 +101,6 @@ otp_8653(suite) -> [];
otp_8653(doc) ->
["OTP-8259. Member was not removed after being killed."];
otp_8653(Config) when is_list(Config) ->
- Timeout = 15,
- ?line Dog = test_server:timetrap({seconds,Timeout}),
-
?line [A, B, C] = start_nodes([a, b, c], peer, Config),
?line wait_for_ready_net(Config),
@@ -136,7 +129,6 @@ otp_8653(Config) when is_list(Config) ->
end),
?line ok = pg2:delete(G),
?line stop_nodes([A,B,C]),
- ?line test_server:timetrap_cancel(Dog),
ok.
part2(Config, Main, A, C) ->
@@ -162,9 +154,6 @@ otp_8259(suite) -> [];
otp_8259(doc) ->
["OTP-8259. Member was not removed after being killed."];
otp_8259(Config) when is_list(Config) ->
- Timeout = 15,
- ?line Dog = test_server:timetrap({seconds,Timeout}),
-
?line [A, B, C] = start_nodes([a, b, c], peer, Config),
?line wait_for_ready_net(Config),
@@ -199,7 +188,6 @@ otp_8259(Config) when is_list(Config) ->
?line ok = pg2:delete(G),
?line stop_nodes([A,B,C]),
- ?line test_server:timetrap_cancel(Dog),
ok.
part1(Config, Main, A, C, Name) ->
@@ -242,8 +230,6 @@ compat(doc) ->
compat(Config) when is_list(Config) ->
case ?t:is_release_available("r13b") of
true ->
- Timeout = 15,
- ?line Dog = test_server:timetrap({seconds,Timeout}),
Pid = spawn(forever()),
G = a,
?line ok = pg2:create(G),
@@ -258,7 +244,7 @@ compat(Config) when is_list(Config) ->
?line ?UNTIL([] =:= pg2:get_members(a)),
?line ?UNTIL([] =:= rpc:call(A, pg2, get_members, [a])),
?t:stop_node(A),
- ?line test_server:timetrap_cancel(Dog);
+ ok;
false ->
{skipped, "No support for old node"}
end.
diff --git a/lib/kernel/test/prim_file_SUITE.erl b/lib/kernel/test/prim_file_SUITE.erl
index 1265180354..c295fab94c 100644
--- a/lib/kernel/test/prim_file_SUITE.erl
+++ b/lib/kernel/test/prim_file_SUITE.erl
@@ -471,7 +471,6 @@ open1(Config) when is_list(Config) ->
modes(suite) -> [];
modes(doc) -> [];
modes(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
?line RootDir = ?config(priv_dir, Config),
?line NewDir = filename:join(RootDir,
atom_to_list(?MODULE)
@@ -509,7 +508,6 @@ modes(Config) when is_list(Config) ->
?line {ok, BinaryMarker} = ?PRIM_FILE:read(Fd5, Length),
?line ok = ?PRIM_FILE:close(Fd5),
- ?line test_server:timetrap_cancel(Dog),
ok.
close(suite) -> [];
@@ -892,14 +890,12 @@ file_info_times_b(Config) when is_list(Config) ->
Result.
file_info_times(Config, Handle, Suffix) ->
- ?line Dog = test_server:timetrap(test_server:seconds(60)),
%% We have to try this twice, since if the test runs across the change
%% of a month the time diff calculations will fail. But it won't happen
%% if you run it twice in succession.
?line test_server:m_out_of_n(
1,2,
fun() -> ?line file_info_int(Config, Handle, Suffix) end),
- ?line test_server:timetrap_cancel(Dog),
ok.
file_info_int(Config, Handle, Suffix) ->
@@ -990,7 +986,6 @@ file_write_file_info_b(Config) when is_list(Config) ->
Result.
file_write_file_info(Config, Handle, Suffix) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
?line RootDir = get_good_directory(Config),
?line test_server:format("RootDir = ~p", [RootDir]),
@@ -1059,7 +1054,6 @@ file_write_file_info(Config, Handle, Suffix) ->
%% test suites ... :-)
?line ?PRIM_FILE_call(write_file_info, Handle,
[Name, #file_info{mode=8#600}]),
- ?line test_server:timetrap_cancel(Dog),
ok.
%% Test the write_file_info/3 function.
@@ -1068,7 +1062,6 @@ file_write_file_info_opts(suite) -> [];
file_write_file_info_opts(doc) -> [];
file_write_file_info_opts(Config) when is_list(Config) ->
{ok, Handle} = ?PRIM_FILE:start(),
- Dog = test_server:timetrap(test_server:seconds(10)),
RootDir = get_good_directory(Config),
test_server:format("RootDir = ~p", [RootDir]),
@@ -1102,14 +1095,12 @@ file_write_file_info_opts(Config) when is_list(Config) ->
erlang:localtime()
]]),
ok = ?PRIM_FILE:stop(Handle),
- test_server:timetrap_cancel(Dog),
ok.
file_read_file_info_opts(suite) -> [];
file_read_file_info_opts(doc) -> [];
file_read_file_info_opts(Config) when is_list(Config) ->
{ok, Handle} = ?PRIM_FILE:start(),
- Dog = test_server:timetrap(test_server:seconds(10)),
RootDir = get_good_directory(Config),
test_server:format("RootDir = ~p", [RootDir]),
@@ -1121,7 +1112,6 @@ file_read_file_info_opts(Config) when is_list(Config) ->
{ok,_} = ?PRIM_FILE_call(read_file_info, Handle, [Name, Opts])
end, [[{time, Type}] || Type <- [local, universal, posix]]),
ok = ?PRIM_FILE:stop(Handle),
- test_server:timetrap_cancel(Dog),
ok.
%% Test the write and read back *_file_info/3 functions.
@@ -1130,7 +1120,6 @@ file_write_read_file_info_opts(suite) -> [];
file_write_read_file_info_opts(doc) -> [];
file_write_read_file_info_opts(Config) when is_list(Config) ->
{ok, Handle} = ?PRIM_FILE:start(),
- Dog = test_server:timetrap(test_server:seconds(10)),
RootDir = get_good_directory(Config),
test_server:format("RootDir = ~p", [RootDir]),
@@ -1148,7 +1137,6 @@ file_write_read_file_info_opts(Config) when is_list(Config) ->
ok = file_write_read_file_info_opts(Handle, Name, 0, [{time, posix}]),
ok = ?PRIM_FILE:stop(Handle),
- test_server:timetrap_cancel(Dog),
ok.
file_write_read_file_info_opts(Handle, Name, Mtime, Opts) ->
@@ -1304,7 +1292,6 @@ large_write(Config) when is_list(Config) ->
"_large_write").
do_large_write(Name) ->
- Dog = test_server:timetrap(test_server:minutes(60)),
ChunkSize = (256 bsl 20) + 1, % 256 M + 1
Chunks = 16, % times 16 -> 4 G + 16
Base = 100,
@@ -1317,19 +1304,18 @@ do_large_write(Name) ->
ok when Wordsize =:= 8 ->
{ok,#file_info{size=Size}} = file:read_file_info(Name),
{ok,Fd} = prim_file:open(Name, [read]),
- check_large_write(Dog, Fd, ChunkSize, 0, Interleave);
+ check_large_write(Fd, ChunkSize, 0, Interleave);
{error,einval} when Wordsize =:= 4 ->
ok
end.
-check_large_write(Dog, Fd, ChunkSize, Pos, [X|Interleave]) ->
+check_large_write(Fd, ChunkSize, Pos, [X|Interleave]) ->
Pos1 = Pos + ChunkSize,
{ok,Pos1} = prim_file:position(Fd, {cur,ChunkSize}),
{ok,[X]} = prim_file:read(Fd, 1),
- check_large_write(Dog, Fd, ChunkSize, Pos1+1, Interleave);
-check_large_write(Dog, Fd, _, _, []) ->
+ check_large_write(Fd, ChunkSize, Pos1+1, Interleave);
+check_large_write(Fd, _, _, []) ->
eof = prim_file:read(Fd, 1),
- test_server:timetrap_cancel(Dog),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1509,7 +1495,6 @@ rename(Config, Handle, Suffix) ->
e_delete(suite) -> [];
e_delete(doc) -> [];
e_delete(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
?line RootDir = ?config(priv_dir, Config),
?line Base = filename:join(RootDir,
atom_to_list(?MODULE)++"_e_delete"),
@@ -1544,7 +1529,6 @@ e_delete(Config) when is_list(Config) ->
Base, #file_info {mode=8#600})
end,
- ?line test_server:timetrap_cancel(Dog),
ok.
%%% FreeBSD gives EEXIST when renaming a file to an empty dir, although the
@@ -1555,7 +1539,6 @@ e_delete(Config) when is_list(Config) ->
e_rename(suite) -> [];
e_rename(doc) -> [];
e_rename(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
?line RootDir = ?config(priv_dir, Config),
?line Base = filename:join(RootDir,
atom_to_list(?MODULE)++"_e_rename"),
@@ -1652,13 +1635,11 @@ e_rename(Config) when is_list(Config) ->
end,
Com
end,
- ?line test_server:timetrap_cancel(Dog),
Comment.
e_make_dir(suite) -> [];
e_make_dir(doc) -> [];
e_make_dir(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
?line RootDir = ?config(priv_dir, Config),
?line Base = filename:join(RootDir,
atom_to_list(?MODULE)++"_e_make_dir"),
@@ -1688,13 +1669,11 @@ e_make_dir(Config) when is_list(Config) ->
?line
?PRIM_FILE:write_file_info(Base, #file_info {mode=8#600})
end,
- ?line test_server:timetrap_cancel(Dog),
ok.
e_del_dir(suite) -> [];
e_del_dir(doc) -> [];
e_del_dir(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
?line RootDir = ?config(priv_dir, Config),
?line Base = filename:join(RootDir,
atom_to_list(?MODULE)++"_e_del_dir"),
@@ -1742,7 +1721,6 @@ e_del_dir(Config) when is_list(Config) ->
?line ?PRIM_FILE:write_file_info(
Base, #file_info {mode=8#600})
end,
- ?line test_server:timetrap_cancel(Dog),
ok.
@@ -1785,8 +1763,6 @@ remove_crs([], Result) ->
lists:reverse(Result).
try_read_file(Fd) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
-
%% Seek to the current position (nothing should happen).
?line {ok, 0} = ?PRIM_FILE:position(Fd, 0),
@@ -1822,13 +1798,11 @@ try_read_file(Fd) ->
%% Done.
?line ?PRIM_FILE:close(Fd),
- ?line test_server:timetrap_cancel(Dog),
ok.
write_compressed(suite) -> [];
write_compressed(doc) -> [];
write_compressed(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
?line Priv = ?config(priv_dir, Config),
?line MyFile = filename:join(Priv,
atom_to_list(?MODULE)++"_test.gz"),
@@ -1872,15 +1846,11 @@ write_compressed(Config) when is_list(Config) ->
?line {ok, NewString} = ?PRIM_FILE:read(Fd3, 1024),
?line ok = ?PRIM_FILE:close(Fd3),
- %% Done.
-
- ?line test_server:timetrap_cancel(Dog),
ok.
compress_errors(suite) -> [];
compress_errors(doc) -> [];
compress_errors(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
?line Data = ?config(data_dir, Config),
?line {error, enoent} = ?PRIM_FILE:open("non_existing__",
[compressed, read]),
@@ -1894,7 +1864,6 @@ compress_errors(Config) when is_list(Config) ->
?line {error, eio} = ?PRIM_FILE:read(Fd, 100),
?line ?PRIM_FILE:close(Fd),
- ?line test_server:timetrap_cancel(Dog),
ok.
@@ -1912,7 +1881,6 @@ make_link_b(Config) when is_list(Config) ->
Result.
make_link(Config, Handle, Suffix) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
?line RootDir = ?config(priv_dir, Config),
?line NewDir = filename:join(RootDir,
atom_to_list(?MODULE)
@@ -1944,7 +1912,6 @@ make_link(Config, Handle, Suffix) ->
ok
end,
- ?line test_server:timetrap_cancel(Dog),
Result.
read_link_info_for_non_link(doc) ->
@@ -1952,11 +1919,7 @@ read_link_info_for_non_link(doc) ->
"(on all platforms).";
read_link_info_for_non_link(suite) -> [];
read_link_info_for_non_link(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
-
?line {ok, #file_info{type=directory}} = ?PRIM_FILE:read_link_info("."),
-
- ?line test_server:timetrap_cancel(Dog),
ok.
symlinks_a(doc) -> "Test operations on symbolic links (for Unix).";
@@ -1973,7 +1936,6 @@ symlinks_b(Config) when is_list(Config) ->
Result.
symlinks(Config, Handle, Suffix) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
?line RootDir = ?config(priv_dir, Config),
?line NewDir = filename:join(RootDir,
atom_to_list(?MODULE)
@@ -2012,7 +1974,6 @@ symlinks(Config, Handle, Suffix) ->
ok
end,
- ?line test_server:timetrap_cancel(Dog),
Result.
%% Creates as many files as possible during a certain time,
@@ -2026,8 +1987,7 @@ list_dir_limit(suite) ->
list_dir_limit(Config) when is_list(Config) ->
?line MaxTime = 120,
?line MaxNumber = 20000,
- ?line Dog = test_server:timetrap(
- test_server:seconds(2*MaxTime + MaxTime)),
+ ct:timetrap({seconds,2*MaxTime + MaxTime}),
?line RootDir = ?config(priv_dir, Config),
?line NewDir = filename:join(RootDir,
atom_to_list(?MODULE)++"_list_dir_limit"),
@@ -2049,7 +2009,6 @@ list_dir_limit(Config) when is_list(Config) ->
?line ok = ?PRIM_FILE:stop(Handle1),
?line ok = ?PRIM_FILE:stop(Handle2),
?line {ok, Number} = Result,
- ?line test_server:timetrap_cancel(Dog),
{comment,
"Created " ++ integer_to_list(Number) ++ " files in "
++ integer_to_list(Time) ++ " seconds."}.
diff --git a/lib/kernel/test/ram_file_SUITE.erl b/lib/kernel/test/ram_file_SUITE.erl
index fdb61a3619..408fadf461 100644
--- a/lib/kernel/test/ram_file_SUITE.erl
+++ b/lib/kernel/test/ram_file_SUITE.erl
@@ -26,7 +26,8 @@
init_per_testcase/2, end_per_testcase/2]).
-export([open_modes/1, open_old_modes/1, pread_pwrite/1, position/1,
truncate/1, sync/1, get_set_file/1, compress/1, uuencode/1,
- large_file_errors/1, large_file_light/1, large_file_heavy/1]).
+ large_file_errors/1, large_file_light/1,
+ large_file_heavy/0, large_file_heavy/1]).
-include_lib("common_test/include/ct.hrl").
-include_lib("kernel/include/file.hrl").
@@ -36,7 +37,9 @@
%%--------------------------------------------------------------------------
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[open_modes, open_old_modes, pread_pwrite, position,
@@ -59,22 +62,11 @@ end_per_group(_GroupName, Config) ->
Config.
-init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) ->
- Time =
- case Func of
- large_file_heavy ->
- ?t:minutes(5);
- _ ->
- ?t:seconds(10)
- end,
- Dog = ?t:timetrap(Time),
- %% error_logger:info_msg("~p:~p *****~n", [?MODULE, Func]),
- [{watchdog, Dog} | Config].
+init_per_testcase(Func, Config) ->
+ Config.
end_per_testcase(_Func, Config) ->
- %% error_logger:info_msg("~p:~p END *****~n", [?MODULE, Func]),
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog).
+ Config.
%%--------------------------------------------------------------------------
%% Test suites
@@ -514,7 +506,6 @@ uuencode(Config) when is_list(Config) ->
ok.
-
large_file_errors(suite) ->
[];
large_file_errors(doc) ->
@@ -575,6 +566,9 @@ large_file_light(Config) when is_list(Config) ->
+large_file_heavy() ->
+ [{timetrap,{minutes,5}}].
+
large_file_heavy(suite) ->
[];
large_file_heavy(doc) ->
diff --git a/lib/kernel/test/rpc_SUITE.erl b/lib/kernel/test/rpc_SUITE.erl
index 42c522b1bd..b45e6bdb59 100644
--- a/lib/kernel/test/rpc_SUITE.erl
+++ b/lib/kernel/test/rpc_SUITE.erl
@@ -30,7 +30,9 @@
-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,2}}].
all() ->
[call, block_call, multicall, multicall_timeout,
@@ -57,7 +59,6 @@ end_per_group(_GroupName, Config) ->
call(doc) -> "Test different rpc calls";
call(Config) when is_list(Config) ->
- Timetrap = ?t:timetrap(?t:seconds(30)),
?line PA = filename:dirname(code:which(?MODULE)),
%% Note. First part of nodename sets response delay in seconds
?line {ok, N1} = ?t:start_node('3_rpc_SUITE_call', slave,
@@ -79,12 +80,10 @@ call(Config) when is_list(Config) ->
?line ?t:stop_node(N2),
?line ?t:stop_node(N3),
?line ?t:stop_node(N4),
- ?t:timetrap_cancel(Timetrap),
ok.
block_call(doc) -> "Test different rpc calls";
block_call(Config) when is_list(Config) ->
- Timetrap = ?t:timetrap(?t:seconds(30)),
?line PA = filename:dirname(code:which(?MODULE)),
%% Note. First part of nodename sets response delay in seconds
?line {ok, N1} = ?t:start_node('3_rpc_SUITE_block_call', slave,
@@ -106,14 +105,12 @@ block_call(Config) when is_list(Config) ->
?line ?t:stop_node(N2),
?line ?t:stop_node(N3),
?line ?t:stop_node(N4),
- ?t:timetrap_cancel(Timetrap),
ok.
multicall(doc) ->
"OTP-3449";
multicall(Config) when is_list(Config) ->
- Timetrap = ?t:timetrap(?t:seconds(20)),
?line PA = filename:dirname(code:which(?MODULE)),
%% Note. First part of nodename sets response delay in seconds
?line {ok, N1} = ?t:start_node('3_rpc_SUITE_multicall', slave,
@@ -127,11 +124,9 @@ multicall(Config) when is_list(Config) ->
?line [] = Msgs,
?line ?t:stop_node(N1),
?line ?t:stop_node(N2),
- ?t:timetrap_cancel(Timetrap),
ok.
multicall_timeout(Config) when is_list(Config) ->
- Timetrap = ?t:timetrap(?t:seconds(30)),
?line PA = filename:dirname(code:which(?MODULE)),
%% Note. First part of nodename sets response delay in seconds
?line {ok, N1} = ?t:start_node('11_rpc_SUITE_multicall', slave,
@@ -152,11 +147,9 @@ multicall_timeout(Config) when is_list(Config) ->
?line ?t:stop_node(N2),
?line ?t:stop_node(N3),
?line ?t:stop_node(N4),
- ?t:timetrap_cancel(Timetrap),
ok.
multicall_dies(Config) when is_list(Config) ->
- Timetrap = ?t:timetrap(?t:seconds(30)),
?line PA = filename:dirname(code:which(?MODULE)),
?line {ok, N1} = ?t:start_node('rpc_SUITE_multicall_dies_1', slave,
[{args, "-pa " ++ PA}]),
@@ -193,7 +186,6 @@ multicall_dies(Config) when is_list(Config) ->
%%
?line ?t:stop_node(N1),
?line ?t:stop_node(N2),
- ?t:timetrap_cancel(Timetrap),
ok.
do_multicall(Nodes, Mod, Func, Args) ->
@@ -208,13 +200,9 @@ do_multicall(Nodes, Mod, Func, Args) ->
multicall_node_dies(doc) ->
"";
multicall_node_dies(Config) when is_list(Config) ->
- Timetrap = ?t:timetrap(?t:seconds(60)),
- %%
do_multicall_2_nodes_dies(?MODULE, suicide, [erlang, halt, []]),
do_multicall_2_nodes_dies(?MODULE, suicide, [init, stop, []]),
do_multicall_2_nodes_dies(?MODULE, suicide, [rpc, stop, []]),
- %%
- ?t:timetrap_cancel(Timetrap),
ok.
do_multicall_2_nodes_dies(Mod, Func, Args) ->
@@ -235,7 +223,6 @@ do_multicall_2_nodes_dies(Mod, Func, Args) ->
called_dies(doc) ->
"OTP-3766";
called_dies(Config) when is_list(Config) ->
- Timetrap = ?t:timetrap(?t:seconds(210)),
?line PA = filename:dirname(code:which(?MODULE)),
?line {ok, N} = ?t:start_node(rpc_SUITE_called_dies, slave,
[{args, "-pa " ++ PA}]),
@@ -320,7 +307,6 @@ called_dies(Config) when is_list(Config) ->
%%
?line [] = flush([]),
?line ?t:stop_node(N),
- ?t:timetrap_cancel(Timetrap),
ok.
rep(Fun, N, M, F, A) ->
@@ -368,7 +354,6 @@ called_node_dies(doc) ->
"";
called_node_dies(suite) -> [];
called_node_dies(Config) when is_list(Config) ->
- Timetrap = ?t:timetrap(?t:minutes(2)),
?line PA = filename:dirname(code:which(?MODULE)),
%%
?line node_rep(
@@ -398,7 +383,6 @@ called_node_dies(Config) when is_list(Config) ->
end, "rpc_SUITE_called_node_dies_4",
PA, ?MODULE, suicide, [rpc,stop,[]]),
%%
- ?t:timetrap_cancel(Timetrap),
ok.
node_rep(Fun, Name, PA, M, F, A) ->
@@ -434,7 +418,6 @@ node_rep(Fun, Name, PA, M, F, A) ->
called_throws(doc) ->
"OTP-3766";
called_throws(Config) when is_list(Config) ->
- Timetrap = ?t:timetrap(?t:seconds(10)),
?line PA = filename:dirname(code:which(?MODULE)),
%%
?line {ok, N} = ?t:start_node(rpc_SUITE_called_throws, slave,
@@ -450,13 +433,11 @@ called_throws(Config) when is_list(Config) ->
end, N, erlang, throw, [{'EXIT',reason}]),
%%
?line ?t:stop_node(N),
- ?t:timetrap_cancel(Timetrap),
ok.
call_benchmark(Config) when is_list(Config) ->
- Timetrap = ?t:timetrap(?t:seconds(120)),
PA = filename:dirname(code:which(?MODULE)),
{ok, Node} = ?t:start_node(rpc_SUITE_call_benchmark, slave,
[{args, "-pa " ++ PA}]),
@@ -466,7 +447,6 @@ call_benchmark(Config) when is_list(Config) ->
end,
Res = do_call_benchmark(Node, Iter),
?t:stop_node(Node),
- ?t:timetrap_cancel(Timetrap),
Res.
do_call_benchmark(Node, M) when is_integer(M), M > 0 ->
@@ -486,8 +466,6 @@ do_call_benchmark(Node, I, M) ->
do_call_benchmark(Node, I+1, M).
async_call(Config) when is_list(Config) ->
- Dog = ?t:timetrap(?t:seconds(120)),
-
%% Note: First part of nodename sets response delay in seconds.
?line PA = filename:dirname(code:which(?MODULE)),
?line NodeArgs = [{args,"-pa "++ PA}],
@@ -510,7 +488,6 @@ async_call(Config) when is_list(Config) ->
?line {value,{hej,_,Node2}} = rpc:nb_yield(Promise2, infinity),
?line {hej,_,Node3} = rpc:yield(Promise3),
- ?t:timetrap_cancel(Dog),
ok.
%%%
diff --git a/lib/kernel/test/seq_trace_SUITE.erl b/lib/kernel/test/seq_trace_SUITE.erl
index fb6f62d2e5..ba6d69b74d 100644
--- a/lib/kernel/test/seq_trace_SUITE.erl
+++ b/lib/kernel/test/seq_trace_SUITE.erl
@@ -40,9 +40,9 @@
monotonic_timestamp,
strict_monotonic_timestamp]).
--define(default_timeout, ?t:minutes(1)).
-
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[token_set_get, tracer_set_get, print, send,
@@ -67,12 +67,9 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
- ?line Dog = test_server:timetrap(?default_timeout),
- [{watchdog, Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
%% Verifies that the set_token and get_token functions work as expected
@@ -480,7 +477,7 @@ match_set_seq_token(doc) ->
"corrupt the heap"];
match_set_seq_token(Config) when is_list(Config) ->
?line Parent = self(),
- ?line Timetrap = test_server:timetrap(test_server:seconds(20)),
+
%% OTP-4222 Match spec 'set_seq_token' corrupts heap
%%
%% This test crashes the emulator if the bug in question is present,
@@ -529,7 +526,6 @@ match_set_seq_token(Config) when is_list(Config) ->
?line ok = check_match_set_seq_token_log(Lbl, Log),
%%
?line stop_node(Sandbox),
- ?line test_server:timetrap_cancel(Timetrap),
ok.
%% OTP-4222 Match spec 'set_seq_token' corrupts heap
@@ -628,7 +624,7 @@ gc_seq_token(doc) ->
"can be garbage collected."];
gc_seq_token(Config) when is_list(Config) ->
?line Parent = self(),
- ?line Timetrap = test_server:timetrap(test_server:seconds(20)),
+
%% OTP-4555 Seq trace token causes free mem read in gc
%%
%% This test crashes the emulator if the bug in question is present,
@@ -676,7 +672,6 @@ gc_seq_token(Config) when is_list(Config) ->
end,
%%
?line stop_node(Sandbox),
- ?line test_server:timetrap_cancel(Timetrap),
ok.
do_gc_seq_token(Label) ->
diff --git a/lib/kernel/test/wrap_log_reader_SUITE.erl b/lib/kernel/test/wrap_log_reader_SUITE.erl
index 27ff98dc17..65a304afae 100644
--- a/lib/kernel/test/wrap_log_reader_SUITE.erl
+++ b/lib/kernel/test/wrap_log_reader_SUITE.erl
@@ -47,7 +47,9 @@
-export([init_per_testcase/2, end_per_testcase/2]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[no_file, {group, one}, {group, two}, {group, four},
@@ -71,13 +73,11 @@ end_per_group(_GroupName, Config) ->
Config.
-init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) ->
- Dog=?t:timetrap(?t:seconds(60)),
- [{watchdog, Dog} | Config].
+init_per_testcase(Func, Config) ->
+ Config.
end_per_testcase(_Func, _Config) ->
- Dog=?config(watchdog, _Config),
- ?t:timetrap_cancel(Dog).
+ ok.
no_file(suite) -> [];
no_file(doc) -> ["No log file exists"];
diff --git a/lib/kernel/test/zlib_SUITE.erl b/lib/kernel/test/zlib_SUITE.erl
index d9d4c138d5..1155157815 100644
--- a/lib/kernel/test/zlib_SUITE.erl
+++ b/lib/kernel/test/zlib_SUITE.erl
@@ -47,11 +47,10 @@
-define(DATA_ERROR, {'EXIT',{data_error,[{zlib,_,_,_}|_]}}).
init_per_testcase(_Func, Config) ->
- Dog = test_server:timetrap(test_server:seconds(60)),
- [{watchdog, Dog}|Config].
-end_per_testcase(_Func, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
+ Config.
+
+end_per_testcase(_Func, _Config) ->
+ ok.
error(Format, Args, File, Line) ->
io:format("~p:~p: ERROR: " ++ Format, [File,Line|Args]),
@@ -70,7 +69,9 @@ error(Format, Args, File, Line) ->
%% end,
%% log("<>ERROR<>~n" ++ Format, Args, File, Line).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[{group, api}, {group, examples}, {group, func}, smp,