From f17020af337cf34560e939d822229262a214f28d Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Wed, 3 Oct 2012 14:34:10 +0200 Subject: test: fix timetraps Use ct:timetrap/1 instead of test_server:timetrap/1 for really long test_cases. Commontest sets up a default timetrap on 30 min, which is not cancelled if testserver:timetrap called. --- lib/asn1/test/asn1_SUITE.erl | 5 +++-- lib/stdlib/test/id_transform_SUITE.erl | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/asn1/test/asn1_SUITE.erl b/lib/asn1/test/asn1_SUITE.erl index b0c37d79e7..501157b9b4 100644 --- a/lib/asn1/test/asn1_SUITE.erl +++ b/lib/asn1/test/asn1_SUITE.erl @@ -1,3 +1,4 @@ +%% %% %CopyrightBegin% %% %% Copyright Ericsson AB 2001-2012. All Rights Reserved. @@ -242,8 +243,8 @@ init_per_testcase(Func, Config) -> true = code:add_patha(CaseDir), Dog = case Func of - testX420 -> test_server:timetrap({minutes, 90}); - _ -> test_server:timetrap({minutes, 60}) + testX420 -> ct:timetrap({minutes, 90}); + _ -> ct:timetrap({minutes, 60}) end, [{case_dir, CaseDir}, {watchdog, Dog}|Config]. diff --git a/lib/stdlib/test/id_transform_SUITE.erl b/lib/stdlib/test/id_transform_SUITE.erl index 233b0d0a78..ee97ffe7b3 100644 --- a/lib/stdlib/test/id_transform_SUITE.erl +++ b/lib/stdlib/test/id_transform_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2011. All Rights Reserved. +%% Copyright Ericsson AB 2003-2012. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -61,7 +61,7 @@ id_transform(Config) when is_list(Config) -> ?line {module,erl_id_trans}=code:load_binary(erl_id_trans,File,Bin), ?line case test_server:purify_is_running() of false -> - Dog = ?t:timetrap(?t:hours(1)), + Dog = ct:timetrap(?t:hours(1)), ?line Res = run_in_test_suite(), ?t:timetrap_cancel(Dog), Res; -- cgit v1.2.3