diff options
author | Björn Gustavsson <[email protected]> | 2016-03-02 16:10:02 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-03-09 14:02:50 +0100 |
commit | 9870d22b2401b60221aa42c78bdb7ec4a812e9e7 (patch) | |
tree | f0d4e4d0feb88c64695cb63d6d072969b2a157ff /lib/kernel/test/ram_file_SUITE.erl | |
parent | bb1eb9bfa336afeb945fd1a5c494cfdaefb5183d (diff) | |
download | otp-9870d22b2401b60221aa42c78bdb7ec4a812e9e7.tar.gz otp-9870d22b2401b60221aa42c78bdb7ec4a812e9e7.tar.bz2 otp-9870d22b2401b60221aa42c78bdb7ec4a812e9e7.zip |
Modernize timetraps
Diffstat (limited to 'lib/kernel/test/ram_file_SUITE.erl')
-rw-r--r-- | lib/kernel/test/ram_file_SUITE.erl | 28 |
1 files changed, 11 insertions, 17 deletions
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) -> |