aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kernel')
-rw-r--r--lib/kernel/test/application_SUITE.erl58
-rw-r--r--lib/kernel/test/erl_boot_server_SUITE.erl4
-rw-r--r--lib/kernel/test/erl_prim_loader_SUITE.erl8
-rw-r--r--lib/kernel/test/file_SUITE.erl30
-rw-r--r--lib/kernel/test/gen_tcp_misc_SUITE.erl40
-rw-r--r--lib/kernel/test/global_SUITE.erl62
-rw-r--r--lib/kernel/test/global_group_SUITE.erl56
-rw-r--r--lib/kernel/test/heart_SUITE.erl14
-rw-r--r--lib/kernel/test/init_SUITE.erl6
-rw-r--r--lib/kernel/test/kernel_config_SUITE.erl2
-rw-r--r--lib/kernel/test/os_SUITE.erl10
-rw-r--r--lib/kernel/test/pg2_SUITE.erl2
-rw-r--r--lib/kernel/test/prim_file_SUITE.erl2
-rw-r--r--lib/kernel/test/rpc_SUITE.erl8
14 files changed, 152 insertions, 150 deletions
diff --git a/lib/kernel/test/application_SUITE.erl b/lib/kernel/test/application_SUITE.erl
index 46c8d82a3b..18f6ab8212 100644
--- a/lib/kernel/test/application_SUITE.erl
+++ b/lib/kernel/test/application_SUITE.erl
@@ -193,7 +193,7 @@ failover(Conf) when is_list(Conf) ->
global:sync(),
ok = rpc:call(Cp1_3, application, load, [app_sp()]),
ok = rpc:call(Cp1_3, application, start, [app_sp, permanent]),
- test_server:sleep(500),
+ ct:sleep(500),
false = is_started(app_sp, Cp1_3),
true = is_started(app_sp, Cp2_2),
@@ -303,7 +303,7 @@ failover_comp(Conf) when is_list(Conf) ->
ok = rpc:call(Cp1_3, application, load, [app3()]),
true = is_loaded(app3, Cp1_3),
ok = rpc:call(Cp1_3, application, start, [app3, permanent]),
- test_server:sleep(5000),
+ ct:sleep(5000),
false = is_started(app3, Cp1_3),
true = is_started(app3, Cp2_2),
@@ -377,7 +377,7 @@ permissions(Conf) when is_list(Conf) ->
?UNTIL(is_loaded(app3, Cps)),
{[ok,ok,ok],[]} =
rpc:multicall(Cps, application, start, [app3, permanent]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app3, Cp1),
false = is_started(app3, Cp2),
false = is_started(app3, Cp3),
@@ -688,14 +688,14 @@ permit_false_start_local(Conf) when is_list(Conf) ->
{[ok,ok,ok],[]} =
rpc:multicall([Cp1, Cp2, Cp3], application, load, [app3()]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app1, Cp1),
false = is_started(app1, Cp2),
false = is_started(app1, Cp3),
%Permit a not started application
ok = rpc:call(Cp1, application, permit, [app3, true]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app3, Cp1),
false = is_started(app3, Cp2),
false = is_started(app3, Cp3),
@@ -703,14 +703,14 @@ permit_false_start_local(Conf) when is_list(Conf) ->
%Permit a not loaded application
{error,{not_loaded,app_notloaded}} =
rpc:call(Cp1, application, permit, [app_notloaded, true]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app_notloaded, Cp1),
false = is_started(app_notloaded, Cp2),
false = is_started(app_notloaded, Cp3),
%Unpermit a not started application
ok = rpc:call(Cp1, application, permit, [app3, false]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app3, Cp1),
false = is_started(app3, Cp2),
false = is_started(app3, Cp3),
@@ -718,7 +718,7 @@ permit_false_start_local(Conf) when is_list(Conf) ->
%Unpermit a not loaded application
{error,{not_loaded,app_notloaded}} =
rpc:call(Cp1, application, permit, [app_notloaded, false]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app_notloaded, Cp1),
false = is_started(app_notloaded, Cp2),
false = is_started(app_notloaded, Cp3),
@@ -731,7 +731,7 @@ permit_false_start_local(Conf) when is_list(Conf) ->
% Permit it again
ok = rpc:call(Cp1, application, permit, [app1, true]),
- test_server:sleep(1000),
+ ct:sleep(1000),
true = is_started(app1, Cp1),
false = is_started(app1, Cp2),
false = is_started(app1, Cp3),
@@ -756,7 +756,7 @@ permit_false_start_local(Conf) when is_list(Conf) ->
% Unpermit it agin
ok = rpc:call(Cp1, application, permit, [app1, false]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app1, Cp1),
true = is_started(app1, Cp2),
false = is_started(app1, Cp3),
@@ -775,7 +775,7 @@ permit_false_start_local(Conf) when is_list(Conf) ->
% Unpermit app1 on CP2 and make sure it is stopped
ok = rpc:call(Cp2, application, permit, [app1, false]),
- test_server:sleep(1000),
+ ct:sleep(1000),
?UNTIL(false =:= is_started(app1, Cp2)),
false = is_started(app1, Cp1),
false = is_started(app1, Cp3),
@@ -816,14 +816,14 @@ permit_false_start_dist(Conf) when is_list(Conf) ->
{[ok,ok,ok],[]} =
rpc:multicall(Cps, application, load, [app2()]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app1, Cp1),
false = is_started(app1, Cp2),
false = is_started(app1, Cp3),
%Permit a not started application
ok = rpc:call(Cp1, application, permit, [app2, true]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app2, Cp1),
false = is_started(app2, Cp2),
false = is_started(app2, Cp3),
@@ -831,7 +831,7 @@ permit_false_start_dist(Conf) when is_list(Conf) ->
%Permit a not loaded application
{error,{not_loaded,app3}} =
rpc:call(Cp1, application, permit, [app3, true]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app3, Cp1),
false = is_started(app3, Cp2),
false = is_started(app3, Cp3),
@@ -840,7 +840,7 @@ permit_false_start_dist(Conf) when is_list(Conf) ->
ok = rpc:call(Cp1, application, permit, [app2, false]),
{[ok,ok,ok],[]} =
rpc:multicall([Cp1, Cp2, Cp3], application, start, [app2, permanent]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app2, Cp1),
false = is_started(app2, Cp2),
false = is_started(app2, Cp3),
@@ -853,7 +853,7 @@ permit_false_start_dist(Conf) when is_list(Conf) ->
?UNTIL(is_loaded(app3, Cps)),
{[ok,ok,ok],[]} =
rpc:multicall(Cps, application, start, [app3, permanent]),
- test_server:sleep(1000),
+ ct:sleep(1000),
false = is_started(app3, Cp1),
false = is_started(app3, Cp2),
false = is_started(app3, Cp3),
@@ -878,7 +878,7 @@ permit_false_start_dist(Conf) when is_list(Conf) ->
% Permit app1 on CP2 and make sure it is not started
ok = rpc:call(Cp2, application, permit, [app1, true]),
- test_server:sleep(1000),
+ ct:sleep(1000),
true = is_started(app1, Cp1),
false = is_started(app1, Cp2),
false = is_started(app1, Cp3),
@@ -945,7 +945,7 @@ nodedown_start(Conf) when is_list(Conf) ->
{[ok,ok],[]} =
rpc:multicall([Cp1, Cp2], application, load, [app1()]),
_ = rpc:cast(Cp2, application, start, [app1, permanent]),
- test_server:sleep(1000),
+ ct:sleep(1000),
% Crash CP1 and make sure app1 is started on CP2
stop_node_nice(Cp1),
@@ -1179,7 +1179,7 @@ otp_2718(Conf) when is_list(Conf) ->
?UNTIL(is_loaded(trans_normal, Cp1)),
{error, {{'EXIT',normal},_}} =
rpc:call(Cp1, application, start, [trans_normal, transient]),
- test_server:sleep(2000),
+ ct:sleep(2000),
false = is_started(trans_normal, Cp1),
%% abnormal exit from the application
@@ -1187,7 +1187,7 @@ otp_2718(Conf) when is_list(Conf) ->
{error, {bad_return,{{trans_abnormal_sup,start,[normal,[]]},
{'EXIT',abnormal}}}} =
rpc:call(Cp1, application, start, [trans_abnormal, transient]),
- test_server:sleep(3000),
+ ct:sleep(3000),
{badrpc,nodedown} = which_applications(Cp1),
ok.
@@ -1301,7 +1301,7 @@ otp_3184(Conf) when is_list(Conf) ->
% Start app1 and make sure it is not started
{[ok,ok],[]} =
rpc:multicall([Cp1, Cp2], application, load, [app1()]),
- test_server:sleep(3000),
+ ct:sleep(3000),
false = is_started(app1, Cp1),
false = is_started(app1, Cp2),
@@ -1469,11 +1469,11 @@ otp_4227(Conf) when is_list(Conf) ->
%% Start app9 and brutally kill it, then try to start app10
ok = rpc:call(Cp1, application, start, [app9]),
- test_server:sleep(1000),
+ ct:sleep(1000),
Pid9 = rpc:call(Cp1, erlang, whereis, [ch_sup19]),
true = erlang:is_pid(Pid9),
true = erlang:exit(Pid9, kill),
- test_server:sleep(1000),
+ ct:sleep(1000),
%% This gave {error, no_report} before the patch
{error, {not_running, app9}} =
@@ -1751,7 +1751,7 @@ distr_changed_tc1(Conf) when is_list(Conf) ->
rpc:multicall([Cp1, Cp2, Cp3],
application_controller, config_change, [OldEnv]),
- test_server:sleep(7000),
+ ct:sleep(7000),
DcInfo1 = rpc:call(Cp1, dist_ac, info, []),
DcInfo2 = rpc:call(Cp2, dist_ac, info, []),
@@ -1837,9 +1837,9 @@ distr_changed_tc2(Conf) when is_list(Conf) ->
rpc:multicall([Cp1, Cp2, Cp3],
application_controller, config_change, [OldEnv]),
- test_server:sleep(4000),
+ ct:sleep(4000),
stop_node_nice(Cp1),
- test_server:sleep(10000),
+ ct:sleep(10000),
% _DcInfo1 = rpc:call(Cp1, dist_ac, info, []),
_DcInfo2 = rpc:call(Cp2, dist_ac, info, []),
@@ -1876,7 +1876,7 @@ distr_changed_tc2(Conf) when is_list(Conf) ->
{ok, Cp1} = start_node_boot(Ncp1, Config2, dc),
- test_server:sleep(10000),
+ ct:sleep(10000),
_DcInfo1rs = rpc:call(Cp1, dist_ac, info, []),
_DcInfo2rs = rpc:call(Cp2, dist_ac, info, []),
@@ -2600,7 +2600,7 @@ wait_until_started(Name, Nodes) ->
true ->
true;
false ->
- test_server:sleep(500),
+ ct:sleep(500),
wait_until_started(Name, Nodes)
end.
@@ -2614,7 +2614,7 @@ wait_until_stopped(Name, Nodes) ->
false ->
true;
true ->
- test_server:sleep(500),
+ ct:sleep(500),
wait_until_stopped(Name, Nodes)
end.
diff --git a/lib/kernel/test/erl_boot_server_SUITE.erl b/lib/kernel/test/erl_boot_server_SUITE.erl
index 0267420cab..f416093e17 100644
--- a/lib/kernel/test/erl_boot_server_SUITE.erl
+++ b/lib/kernel/test/erl_boot_server_SUITE.erl
@@ -79,12 +79,12 @@ start(Config) when is_list(Config) ->
?line exit(Pid1, kill),
%% Test again.
- test_server:sleep(1),
+ ct:sleep(1),
?line {ok, Pid2} = erl_boot_server:start([Host1, Host2]),
?line {error, {already_started, Pid2}} =
erl_boot_server:start([Host1, Host2]),
?line exit(Pid2, kill),
- test_server:sleep(1),
+ ct:sleep(1),
ok.
diff --git a/lib/kernel/test/erl_prim_loader_SUITE.erl b/lib/kernel/test/erl_prim_loader_SUITE.erl
index 3c4fda2910..a8e610a7d8 100644
--- a/lib/kernel/test/erl_prim_loader_SUITE.erl
+++ b/lib/kernel/test/erl_prim_loader_SUITE.erl
@@ -181,7 +181,7 @@ inet_coming_up(Config) when is_list(Config) ->
Node = start_node_using_inet(Name, [{wait,false}]),
%% Wait a while, then start boot server, and wait for node to start.
- test_server:sleep(test_server:seconds(6)),
+ ct:sleep({seconds,6}),
BootPid = start_boot_server(),
wait_really_started(Node, 25),
@@ -199,7 +199,7 @@ wait_really_started(Node, N) ->
{started, _} ->
ok;
_ ->
- test_server:sleep(1000),
+ ct:sleep(1000),
wait_really_started(Node, N - 1)
end.
@@ -295,11 +295,11 @@ multiple_slaves(Config) when is_list(Config) ->
%% (note: test_server supervises each node start by accept()
%% on a socket, the timeout value for the accept has to be quite
%% long for this test to work).
- ?line test_server:sleep(test_server:seconds(5)),
+ ct:sleep({seconds,5}),
%% start the code loading circus!
BootPid = start_boot_server(),
%% give the nodes a chance to boot up before attempting to stop them
- ?line test_server:sleep(test_server:seconds(10)),
+ ct:sleep({seconds,10}),
?line wait_and_shutdown(lists:reverse(Nodes), 30),
diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl
index f67e1228c6..2319f294f4 100644
--- a/lib/kernel/test/file_SUITE.erl
+++ b/lib/kernel/test/file_SUITE.erl
@@ -1484,7 +1484,7 @@ file_info_int(Config) ->
%% Sleep until we can be sure the seconds value has changed.
%% Note: FAT-based filesystem (like on Windows 95) have
%% a resolution of 2 seconds.
- ?line test_server:sleep(test_server:seconds(2.2)),
+ timer:sleep(2200),
%% close the file, and watch the modify date change
?line ok = ?FILE_MODULE:close(Fd1),
@@ -3018,18 +3018,18 @@ delayed_write(Config) when is_list(Config) ->
{ok, Fd1} =
?FILE_MODULE:open(File, [write, {delayed_write, Size+1, 2000}]),
ok = ?FILE_MODULE:write(Fd1, Data1),
- ?t:sleep(1000), % Just in case the file system is slow
+ timer:sleep(1000), % Just in case the file system is slow
{ok, Fd2} = ?FILE_MODULE:open(File, [read]),
eof = ?FILE_MODULE:read(Fd2, 1),
ok = ?FILE_MODULE:write(Fd1, Data1), % Data flush on size
- ?t:sleep(1000), % Just in case the file system is slow
+ timer:sleep(1000), % Just in case the file system is slow
{ok, Data1Data1} = ?FILE_MODULE:pread(Fd2, bof, 2*Size+1),
ok = ?FILE_MODULE:write(Fd1, Data1),
- ?t:sleep(3000), % Wait until data flush on timeout
+ timer:sleep(3000), % Wait until data flush on timeout
{ok, Data1Data1Data1} = ?FILE_MODULE:pread(Fd2, bof, 3*Size+1),
ok = ?FILE_MODULE:write(Fd1, Data1),
ok = ?FILE_MODULE:close(Fd1), % Data flush on close
- ?t:sleep(1000), % Just in case the file system is slow
+ timer:sleep(1000), % Just in case the file system is slow
{ok, Data1Data1Data1Data1} = ?FILE_MODULE:pread(Fd2, bof, 4*Size+1),
ok = ?FILE_MODULE:close(Fd2),
%%
@@ -3063,7 +3063,7 @@ delayed_write(Config) when is_list(Config) ->
{'DOWN', Mref1, _, _, _} = Down1a ->
ct:fail(Down1a)
end,
- ?t:sleep(1000), % Just in case the file system is slow
+ timer:sleep(1000), % Just in case the file system is slow
{ok, Fd3} = ?FILE_MODULE:open(File, [read]),
eof = ?FILE_MODULE:read(Fd3, 1),
Child1 ! {Parent, continue, normal},
@@ -3073,7 +3073,7 @@ delayed_write(Config) when is_list(Config) ->
{'DOWN', Mref1, _, _, _} = Down1b ->
ct:fail(Down1b)
end,
- ?t:sleep(1000), % Just in case the file system is slow
+ timer:sleep(1000), % Just in case the file system is slow
{ok, Data1} = ?FILE_MODULE:pread(Fd3, bof, Size+1),
ok = ?FILE_MODULE:close(Fd3),
%%
@@ -3086,7 +3086,7 @@ delayed_write(Config) when is_list(Config) ->
{'DOWN', Mref2, _, _, _} = Down2a ->
ct:fail(Down2a)
end,
- ?t:sleep(1000), % Just in case the file system is slow
+ timer:sleep(1000), % Just in case the file system is slow
{ok, Fd4} = ?FILE_MODULE:open(File, [read]),
eof = ?FILE_MODULE:read(Fd4, 1),
Child2 ! {Parent, continue, kill},
@@ -3096,7 +3096,7 @@ delayed_write(Config) when is_list(Config) ->
{'DOWN', Mref2, _, _, _} = Down2b ->
ct:fail(Down2b)
end,
- ?t:sleep(1000), % Just in case the file system is slow
+ timer:sleep(1000), % Just in case the file system is slow
eof = ?FILE_MODULE:pread(Fd4, bof, 1),
ok = ?FILE_MODULE:close(Fd4),
%%
@@ -3130,7 +3130,7 @@ pid2name(Config) when is_list(Config) ->
?line {ok, Name2} = file:pid2name(Pid),
?line undefined = file:pid2name(self()),
?line ok = file:close(Pid),
- ?line test_server:sleep(1000),
+ ct:sleep(1000),
?line false = is_process_alive(Pid),
?line undefined = file:pid2name(Pid),
ok.
@@ -3157,15 +3157,15 @@ read_ahead(Config) when is_list(Config) ->
%% Test caching of normal non-raw file
?line {ok, Fd1} = ?FILE_MODULE:open(File, [write]),
?line ok = ?FILE_MODULE:write(Fd1, [Data1|Data1]),
- ?line ?t:sleep(1000), % Just in case the file system is slow
+ timer:sleep(1000), % Just in case the file system is slow
?line {ok, Fd2} = ?FILE_MODULE:open(File, [read, {read_ahead, 2*Size}]),
?line {ok, Data1} = ?FILE_MODULE:read(Fd2, Size),
?line ok = ?FILE_MODULE:pwrite(Fd1, Size, Data2),
- ?line ?t:sleep(1000), % Just in case the file system is slow
+ timer:sleep(1000), % Just in case the file system is slow
?line {ok, Data1} = ?FILE_MODULE:read(Fd2, Size), % Will read cached data
?line Data2Data2Data2 = Data2++Data2++Data2,
?line ok = ?FILE_MODULE:pwrite(Fd1, eof, Data2Data2Data2),
- ?line ?t:sleep(1000), % Just in case the file system is slow
+ timer:sleep(1000), % Just in case the file system is slow
?line {ok, Data2Data2Data2} =
?FILE_MODULE:read(Fd2, 3*Size), % Read more than cache buffer
?line ok = ?FILE_MODULE:close(Fd1),
@@ -3173,11 +3173,11 @@ read_ahead(Config) when is_list(Config) ->
%% Test caching of raw file and default parameters
?line {ok, Fd3} = ?FILE_MODULE:open(File, [raw, write]),
?line ok = ?FILE_MODULE:write(Fd3, [Data1|Data1]),
- ?line ?t:sleep(1000), % Just in case the file system is slow
+ timer:sleep(1000), % Just in case the file system is slow
?line {ok, Fd4} = ?FILE_MODULE:open(File, [raw, read, read_ahead]),
?line {ok, Data1} = ?FILE_MODULE:read(Fd4, Size),
?line ok = ?FILE_MODULE:pwrite(Fd3, Size, Data2),
- ?line ?t:sleep(1000), % Just in case the file system is slow
+ timer:sleep(1000), % Just in case the file system is slow
?line {ok, Data1} = ?FILE_MODULE:read(Fd4, Size), % Will read cached data
?line ok = ?FILE_MODULE:close(Fd3),
?line ok = ?FILE_MODULE:close(Fd4),
diff --git a/lib/kernel/test/gen_tcp_misc_SUITE.erl b/lib/kernel/test/gen_tcp_misc_SUITE.erl
index 3e953e4692..97eb5f0b61 100644
--- a/lib/kernel/test/gen_tcp_misc_SUITE.erl
+++ b/lib/kernel/test/gen_tcp_misc_SUITE.erl
@@ -737,7 +737,7 @@ do_iter_max_socks(N, First) when is_integer(First) ->
true ->
io:format("Sleeping for ~p seconds...~n",
[?RETRY_SLEEP/1000]),
- ?t:sleep(?RETRY_SLEEP),
+ ct:sleep(?RETRY_SLEEP),
io:format("Trying again...~n", []),
RetryMS = max_socks(),
if RetryMS == First ->
@@ -755,7 +755,7 @@ all_equal([Rule | T]) ->
all_equal(Rule, [Rule | T]) ->
all_equal(Rule, T);
all_equal(_, [_ | _]) ->
- ?t:sleep(?RECOVER_SLEEP), % Wait a while and *hope* that we'll
+ ct:sleep(?RECOVER_SLEEP), % Wait a while and *hope* that we'll
% recover so other tests won't be
% affected.
ct:fail(max_socket_mismatch);
@@ -809,7 +809,7 @@ passive_sockets(Config) when is_list(Config) ->
receive
{socket,Port} -> ok
end,
- ?t:sleep(500),
+ ct:sleep(500),
case gen_tcp:connect("localhost", Port, [{active, false}]) of
{ok, Sock} ->
passive_sockets_read(Sock);
@@ -846,7 +846,7 @@ passive_sockets_server(Opts, Parent) ->
passive_sockets_server_accept(Sock) ->
case gen_tcp:accept(Sock) of
{ok, Socket} ->
- ?t:sleep(500), % Simulate latency
+ timer:sleep(500), % Simulate latency
passive_sockets_server_send(Socket, 5),
passive_sockets_server_accept(Sock);
Error ->
@@ -860,7 +860,7 @@ passive_sockets_server_send(Socket, X) ->
Data = lists:duplicate(1024*X, $a),
case gen_tcp:send(Socket, Data) of
ok ->
- ?t:sleep(50), % Simulate some processing.
+ ct:sleep(50), % Simulate some processing.
passive_sockets_server_send(Socket, X-1);
{error, _Reason} ->
ct:fail("Failed to send data")
@@ -912,7 +912,7 @@ closed_socket(Config) when is_list(Config) ->
%% in inet_db processes the 'EXIT' message from the port,
%% the socket is unregistered.
%%
- %% test_server:sleep(test_server:seconds(2)),
+ %% ct:sleep({seconds,2})
%%
{error, R_send} = gen_tcp:send(LS1, "data"),
{error, R_recv} = gen_tcp:recv(LS1, 17),
@@ -1129,7 +1129,7 @@ show_econnreset_active_once(Config) when is_list(Config) ->
ok = gen_tcp:close(L),
ok = inet:setopts(Client, [{linger, {true, 0}}]),
ok = gen_tcp:close(Client),
- ok = ?t:sleep(20),
+ ok = ct:sleep(20),
ok = receive Msg -> {unexpected_msg, Msg} after 0 -> ok end,
ok = inet:setopts(S, [{active, once}]),
receive
@@ -1157,7 +1157,7 @@ show_econnreset_passive(Config) when is_list(Config) ->
ok = gen_tcp:close(L),
ok = inet:setopts(S, [{linger, {true, 0}}]),
ok = gen_tcp:close(S),
- ok = ?t:sleep(1),
+ ok = ct:sleep(1),
{error, closed} = gen_tcp:recv(Client, 0),
%% Now test with option switched on.
@@ -1170,7 +1170,7 @@ show_econnreset_passive(Config) when is_list(Config) ->
ok = gen_tcp:close(L1),
ok = inet:setopts(S1, [{linger, {true, 0}}]),
ok = gen_tcp:close(S1),
- ok = ?t:sleep(1),
+ ok = ct:sleep(1),
{error, econnreset} = gen_tcp:recv(Client1, 0).
econnreset_after_sync_send(Config) when is_list(Config) ->
@@ -1182,7 +1182,7 @@ econnreset_after_sync_send(Config) when is_list(Config) ->
ok = gen_tcp:close(L),
ok = inet:setopts(S, [{linger, {true, 0}}]),
ok = gen_tcp:close(S),
- ok = ?t:sleep(20),
+ ok = ct:sleep(20),
{error, closed} = gen_tcp:send(Client, "Whatever"),
%% Now test with option switched on.
@@ -1195,7 +1195,7 @@ econnreset_after_sync_send(Config) when is_list(Config) ->
ok = gen_tcp:close(L1),
ok = inet:setopts(S1, [{linger, {true, 0}}]),
ok = gen_tcp:close(S1),
- ok = ?t:sleep(20),
+ ok = ct:sleep(20),
{error, econnreset} = gen_tcp:send(Client1, "Whatever").
econnreset_after_async_send_active(Config) when is_list(Config) ->
@@ -1215,10 +1215,10 @@ econnreset_after_async_send_active(Config) when is_list(Config) ->
{queue_size, 0} = T -> ct:fail(T)
end,
ok = gen_tcp:send(S, "Whatever"),
- ok = ?t:sleep(20),
+ ok = ct:sleep(20),
ok = inet:setopts(S, [{linger, {true, 0}}]),
ok = gen_tcp:close(S),
- ok = ?t:sleep(20),
+ ok = ct:sleep(20),
receive
{tcp, Client, "Whatever"} ->
receive
@@ -1246,10 +1246,10 @@ econnreset_after_async_send_active(Config) when is_list(Config) ->
{queue_size, 0} = T1 -> ct:fail(T1)
end,
ok = gen_tcp:send(S1, "Whatever"),
- ok = ?t:sleep(20),
+ ok = ct:sleep(20),
ok = inet:setopts(S1, [{linger, {true, 0}}]),
ok = gen_tcp:close(S1),
- ok = ?t:sleep(20),
+ ok = ct:sleep(20),
receive
{tcp, Client1, "Whatever"} ->
receive
@@ -1285,10 +1285,10 @@ econnreset_after_async_send_active_once(Config) when is_list(Config) ->
{queue_size, 0} = T -> ct:fail(T)
end,
ok = gen_tcp:send(S, "Whatever"),
- ok = ?t:sleep(20),
+ ok = ct:sleep(20),
ok = inet:setopts(S, [{linger, {true, 0}}]),
ok = gen_tcp:close(S),
- ok = ?t:sleep(20),
+ ok = ct:sleep(20),
ok = receive Msg -> {unexpected_msg, Msg} after 0 -> ok end,
ok = inet:setopts(Client, [{active, once}]),
receive
@@ -1324,7 +1324,7 @@ econnreset_after_async_send_passive(Config) when is_list(Config) ->
{queue_size, 0} = T -> ct:fail(T)
end,
ok = gen_tcp:close(S),
- ok = ?t:sleep(20),
+ ok = ct:sleep(20),
{error, closed} = gen_tcp:recv(Client, 0),
%% Now test with option switched on.
@@ -1340,7 +1340,7 @@ econnreset_after_async_send_passive(Config) when is_list(Config) ->
ok = gen_tcp:send(S1, "Whatever"),
ok = gen_tcp:send(Client1, Payload),
ok = gen_tcp:close(S1),
- ok = ?t:sleep(20),
+ ok = ct:sleep(20),
{error, econnreset} = gen_tcp:recv(Client1, 0).
%%
@@ -1371,7 +1371,7 @@ linger_zero(Config) when is_list(Config) ->
end,
ok = inet:setopts(Client, [{linger, {true, 0}}]),
ok = gen_tcp:close(Client),
- ok = ?t:sleep(1),
+ ok = ct:sleep(1),
undefined = erlang:port_info(Client, connected),
{error, econnreset} = gen_tcp:recv(S, PayloadSize).
diff --git a/lib/kernel/test/global_SUITE.erl b/lib/kernel/test/global_SUITE.erl
index 2a5e10f00a..7ec1b1ea53 100644
--- a/lib/kernel/test/global_SUITE.erl
+++ b/lib/kernel/test/global_SUITE.erl
@@ -683,7 +683,7 @@ locks(Config) when is_list(Config) ->
?line true = req(Pid3, {set_lock, test_lock2, self()}),
% del one lock
?line Pid3 ! {del_lock, test_lock2},
- ?line test_server:sleep(100),
+ ct:sleep(100),
% check that one lock is still set, but not the other
?line false = global:set_lock({test_lock, self()}, ?NODES, 1),
?line true = global:set_lock({test_lock2, self()}, ?NODES, 1),
@@ -722,10 +722,10 @@ locks(Config) when is_list(Config) ->
stop_node(Cp1),
stop_node(Cp2),
stop_node(Cp3),
- ?line test_server:sleep(100),
+ ct:sleep(100),
?line true = req(Pid8, {set_lock, test_lock, self()}),
exit_p(Pid8),
- ?line test_server:sleep(10),
+ ct:sleep(10),
?line init_condition(Config),
ok.
@@ -864,7 +864,7 @@ names_and_locks(Config) when is_list(Config) ->
?line false = req(Pid3, {set_lock, test_lock, self(), [Cp2, Cp3]}),
% release lock
Pid2 ! {del_lock, test_lock, [Cp2, Cp3]},
- ?line test_server:sleep(100),
+ ct:sleep(100),
% try to set lock on a node that already has the lock
?line false = req(Pid2, {set_lock, test_lock, self(), [Cp1, Cp2, Cp3]}),
% set two locks
@@ -1100,7 +1100,7 @@ basic_name_partition(Config) when is_list(Config) ->
% start different processes in both partitions
?line {_, yes} = start_proc_basic(name03),
?line {_, yes} = rpc:call(Cp1, ?MODULE, start_proc_basic, [name12]),
- test_server:sleep(1000),
+ ct:sleep(1000),
% connect to other partition
?line pong = net_adm:ping(Cp3),
@@ -1401,7 +1401,7 @@ ring(Config) when is_list(Config) ->
?line rpc_cast(Cp8, ?MODULE, single_node, [Time, Cp7, Config]),
% sleep to make the partitioned net ready
- test_server:sleep(Time - msec()),
+ ct:sleep(Time - msec()),
?line pong = net_adm:ping(Cp0),
?line pong = net_adm:ping(Cp1),
@@ -1488,7 +1488,7 @@ simple_ring(Config) when is_list(Config) ->
?line rpc_cast(Cp5, ?MODULE, single_node, [Time, Cp4, Config]),
% sleep to make the partitioned net ready
- test_server:sleep(Time - msec()),
+ ct:sleep(Time - msec()),
?line pong = net_adm:ping(Cp0),
?line pong = net_adm:ping(Cp1),
@@ -1568,7 +1568,7 @@ line(Config) when is_list(Config) ->
?line rpc_cast(Cp8, ?MODULE, single_node, [Time, Cp7, Config]),
% sleep to make the partitioned net ready
- test_server:sleep(Time - msec()),
+ ct:sleep(Time - msec()),
?line pong = net_adm:ping(Cp0),
?line pong = net_adm:ping(Cp1),
@@ -1656,7 +1656,7 @@ simple_line(Config) when is_list(Config) ->
?line rpc_cast(Cp5, ?MODULE, single_node, [Time, Cp4, Config]),
% sleep to make the partitioned net ready
- test_server:sleep(Time - msec()),
+ ct:sleep(Time - msec()),
?line pong = net_adm:ping(Cp0),
?line pong = net_adm:ping(Cp1),
@@ -1889,7 +1889,7 @@ otp_5640(Config) when is_list(Config) ->
?line ok = application:set_env(kernel, global_multi_name_action, allow),
?line yes = global:register_name(name2, Proc),
- test_server:sleep(100),
+ ct:sleep(100),
?line Proc = global:whereis_name(name1),
?line Proc = global:whereis_name(name2),
?line check_everywhere(Nodes, name1, Config),
@@ -1900,7 +1900,7 @@ otp_5640(Config) when is_list(Config) ->
?line {links,[]} = process_info(Proc, links),
?line _ = global:unregister_name(name1),
- test_server:sleep(100),
+ ct:sleep(100),
?line undefined = global:whereis_name(name1),
?line Proc = global:whereis_name(name2),
?line check_everywhere(Nodes, name1, Config),
@@ -1916,7 +1916,7 @@ otp_5640(Config) when is_list(Config) ->
Proc ! die,
- test_server:sleep(100),
+ ct:sleep(100),
?line undefined = global:whereis_name(name1),
?line undefined = global:whereis_name(name2),
?line check_everywhere(Nodes, name1, Config),
@@ -2004,11 +2004,11 @@ simple_disconnect(Config) when is_list(Config) ->
?line {_Pid1, yes} =
rpc:call(Cp1, ?MODULE, start_resolver, [Name, Resolver]),
- test_server:sleep(100),
+ ct:sleep(100),
%% Disconnect test_server and Cp2.
?line true = erlang:disconnect_node(Cp2),
- test_server:sleep(500),
+ ct:sleep(500),
%% _Pid is registered on Cp1. The exchange of names between Cp2 and
%% test_server sees two identical pids.
@@ -2325,7 +2325,7 @@ res({Res,Resolver}, [N1, A2, Z2], Cf) ->
%% Wait for extra monitor processes to be created.
%% This applies as long as global:do_monitor/1 spawns processes.
%% (Some day monitor() will be truly synchronous.)
- test_server:sleep(100),
+ ct:sleep(100),
?line lists:foreach(fun(P) -> P ! die end, Resolvers),
?line lists:foreach(fun(P) -> wait_for_exit(P) end, Resolvers),
@@ -2334,7 +2334,7 @@ res({Res,Resolver}, [N1, A2, Z2], Cf) ->
?line undefined = global:whereis_name(Name),
%% Wait for monitors to remove names.
- test_server:sleep(100),
+ ct:sleep(100),
?line {_, Trace1} = collect_tracers(Nodes),
Trace = Trace0 ++ Trace1,
@@ -2500,12 +2500,12 @@ leftover_name(Config) when is_list(Config) ->
?line {_Pid1, yes} =
rpc:call(N1, ?MODULE, start_resolver,
[ResName, fun contact_a_2/3]),
- test_server:sleep(1000),
+ ct:sleep(1000),
?line trace_message({node(), pinging, z_2}),
?line pong = net_adm:ping(Z2),
?line ?UNTIL((Nodes -- [A2]) =:= lists:sort(?NODES)),
- ?t:sleep(1000),
+ ct:sleep(1000),
?line {_,Trace0} = collect_tracers(Nodes),
@@ -2629,7 +2629,7 @@ do_name_exit(StartFun, Version, Config) ->
Pid ! die,
wait_for_exit_fast(Pid),
- ?t:sleep(100),
+ ct:sleep(100),
%% Name has been removed from node()'s table, but nowhere else
%% since there is a lock on 'global'.
{R1,[]} = rpc:multicall(Nodes, global, whereis_name, [Name]),
@@ -2637,7 +2637,7 @@ do_name_exit(StartFun, Version, Config) ->
old -> [_,_] = lists:usort(R1);
current -> [undefined, undefined, undefined] = R1
end,
- ?t:sleep(3000),
+ ct:sleep(3000),
?line check_everywhere(Nodes, Name, Config),
lists:foreach(fun(N) -> rpc:call(N, ?MODULE, stop_tracer, []) end, Nodes),
@@ -2704,7 +2704,7 @@ external_nodes(Config) when is_list(Config) ->
?line Cpid ! {register, self(), Name},
?line receive {Cpid, Reply1} -> no = Reply1 end,
?line _ = global:unregister_name(Name),
- test_server:sleep(1000),
+ ct:sleep(1000),
?line Cpid ! {register, self(), Name},
?line ?UNTIL(length(get_ext_names()) =:= 1),
?line receive {Cpid, Reply2} -> yes = Reply2 end,
@@ -3619,7 +3619,7 @@ single_node(Time, Node, Config) ->
lists:foreach(fun(N) -> _ = erlang:disconnect_node(N) end, nodes()),
?UNTIL(get_known(node()) =:= [node()]),
spawn(?MODULE, init_2, []),
- test_server:sleep(Time - msec()),
+ ct:sleep(Time - msec()),
net_adm:ping(Node).
init_2() ->
@@ -3681,13 +3681,15 @@ sreq(Pid, Msg) ->
alone(N1, N2) ->
lists:foreach(fun(Node) -> true = erlang:disconnect_node(Node) end,
nodes()),
- test_server:sleep(12000),
+ ct:sleep(12000),
net_adm:ping(N1),
net_adm:ping(N2),
yes = global:register_name(test5, self()).
crash(Time) ->
- test_server:sleep(Time),
+ %% ct:sleep/1 will not work because it calls a server process
+ %% that does not run on other nodes.
+ timer:sleep(Time),
erlang:halt().
loop() ->
@@ -3797,7 +3799,7 @@ start_node(Name0, How, Args, Config) ->
{linked, false}
]),
%% {linked,false} only seems to work for slave nodes.
-% test_server:sleep(1000),
+% ct:sleep(1000),
record_started_node(R).
start_node_rel(Name0, Rel, Config) ->
@@ -3903,7 +3905,7 @@ global_load1(_OtherNode, _OtherName, 2) ->
io:format("*** ~p giving up. No use.", [node()]),
init:stop();
global_load1(OtherNode, OtherName, Fails) ->
- test_server:sleep(1000),
+ ct:sleep(1000),
?line case catch global:whereis_name(OtherName) of
Pid when is_pid(Pid) ->
io:format("~p says: ~p is still there.",
@@ -3956,7 +3958,7 @@ mass_death(Config) when is_list(Config) ->
?line {Pids,[]} = rpc:multicall(Nodes, ?MODULE, mass_spawn, [Ns]),
?line io:format("Pids: ~p~n", [Pids]),
%% Wait...
- ?line test_server:sleep(10000),
+ ct:sleep(10000),
%% Check the globally registered names
?line NewNames = global:registered_names(),
?line io:format("NewNames: ~p~n", [NewNames]),
@@ -3987,7 +3989,7 @@ wait_mass_death(Nodes, OrigNames, Then, Config) ->
{comment,lists:flatten(io_lib:format("~.3f s~n", [T/1000.0]))};
Ndiff ->
?line io:format("Ndiff: ~p~n", [Ndiff]),
- ?line test_server:sleep(1000),
+ ct:sleep(1000),
?line wait_mass_death(Nodes, OrigNames, Then, Config)
end.
@@ -4075,7 +4077,7 @@ start_nodes2([Name | Rest], How, N, Config) ->
Self ! {N, R},
%% sleeping is necessary, or with peer nodes, they will
%% go down again, despite {linked, false}.
- test_server:sleep(100000)
+ ct:sleep(100000)
end),
start_nodes2(Rest, How, N+1, Config).
@@ -4172,7 +4174,7 @@ garbage_messages(Config) when is_list(Config) ->
end
end,
?line Pid = spawn_link(Slave, erlang, apply, [Fun,[]]),
- ?t:sleep(2000),
+ ct:sleep(2000),
?line Global = rpc:call(Slave, erlang, whereis, [global_name_server]),
?line {registered_name,global_name_server} =
rpc:call(Slave, erlang, process_info, [Global,registered_name]),
diff --git a/lib/kernel/test/global_group_SUITE.erl b/lib/kernel/test/global_group_SUITE.erl
index 87a4aa63f8..bfdcb87dc5 100644
--- a/lib/kernel/test/global_group_SUITE.erl
+++ b/lib/kernel/test/global_group_SUITE.erl
@@ -235,9 +235,9 @@ no_gg_proc(Config) when is_list(Config) ->
rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2, {wait_nodedown, Cp1}]),
?line PidX =
rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, {wait_nodedown, Cp1}]),
- ?line test_server:sleep(100),
+ ct:sleep(100),
?line stop_node(Cp1),
- ?line test_server:sleep(1000),
+ ct:sleep(1000),
?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
@@ -247,9 +247,9 @@ no_gg_proc(Config) when is_list(Config) ->
rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2, {wait_nodedown, Cpz}]),
?line PidX =
rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, {wait_nodedown, Cpz}]),
- ?line test_server:sleep(100),
+ ct:sleep(100),
?line stop_node(Cpz),
- ?line test_server:sleep(1000),
+ ct:sleep(1000),
?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
@@ -407,9 +407,9 @@ no_gg_proc_sync(Config) when is_list(Config) ->
rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2, {wait_nodedown, Cp1}]),
?line PidX =
rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, {wait_nodedown, Cp1}]),
- ?line test_server:sleep(100),
+ ct:sleep(100),
?line stop_node(Cp1),
- ?line test_server:sleep(1000),
+ ct:sleep(1000),
?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
@@ -419,9 +419,9 @@ no_gg_proc_sync(Config) when is_list(Config) ->
rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2, {wait_nodedown, Cpz}]),
?line PidX =
rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, {wait_nodedown, Cpz}]),
- ?line test_server:sleep(100),
+ ct:sleep(100),
?line stop_node(Cpz),
- ?line test_server:sleep(1000),
+ ct:sleep(1000),
?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
@@ -578,9 +578,9 @@ compatible(Config) when is_list(Config) ->
rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2, {wait_nodedown, Cp1}]),
?line PidX =
rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, {wait_nodedown, Cp1}]),
- ?line test_server:sleep(100),
+ ct:sleep(100),
?line stop_node(Cp1),
- ?line test_server:sleep(1000),
+ ct:sleep(1000),
?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
@@ -590,9 +590,9 @@ compatible(Config) when is_list(Config) ->
rpc:call(Cp2, global_group, send, [{node, Cp2nn}, test2, {wait_nodedown, Cpz}]),
?line PidX =
rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test, {wait_nodedown, Cpz}]),
- ?line test_server:sleep(100),
+ ct:sleep(100),
?line stop_node(Cpz),
- ?line test_server:sleep(1000),
+ ct:sleep(1000),
?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
@@ -651,7 +651,7 @@ one_grp(Config) when is_list(Config) ->
?line {ok, Cp3} = start_node(Ncp3, Config),
% sleep a while to make the global_group to sync...
- test_server:sleep(1000),
+ ct:sleep(1000),
% start a proc and register it
?line {Pid, yes} = rpc:call(Cp1, ?MODULE, start_proc, [test]),
@@ -732,14 +732,14 @@ one_grp_x(Config) when is_list(Config) ->
?line {ok, Cp1} = start_node(Ncp1, Config),
% sleep a while to make the global_group to sync...
- test_server:sleep(1000),
+ ct:sleep(1000),
% start a proc and register it
?line {Pid, yes} = rpc:call(Cp1, ?MODULE, start_proc, [test]),
?line {ok, Cp2} = start_node(Ncp2, Config),
% sleep a while to make the global_group to sync...
- test_server:sleep(1000),
+ ct:sleep(1000),
% test that it is registered at all nodes
?line Pid = rpc:call(Cp1, global, whereis_name, [test]),
@@ -747,7 +747,7 @@ one_grp_x(Config) when is_list(Config) ->
?line {ok, Cp3} = start_node(Ncp3, Config),
% sleep a while to make the global_group to sync...
- test_server:sleep(1000),
+ ct:sleep(1000),
?line Pid = rpc:call(Cp3, global, whereis_name, [test]),
@@ -809,7 +809,7 @@ two_grp(Config) when is_list(Config) ->
%% [{nc1, [cp1,cp2,cp3]}, {nc2, [cpx,cpy,cpz]}, {nc3, [cpq]}]
% sleep a while to make the global_groups to sync...
- test_server:sleep(1000),
+ ct:sleep(1000),
% check the global group names
?line {nc1, [nc2, nc3]} = rpc:call(Cp1, global_group, global_groups, []),
@@ -1009,9 +1009,9 @@ two_grp(Config) when is_list(Config) ->
{wait_nodedown, Cp1}]),
?line PidX = rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test,
{wait_nodedown, Cp1}]),
- ?line test_server:sleep(100),
+ ct:sleep(100),
?line stop_node(Cp1),
- ?line test_server:sleep(1000),
+ ct:sleep(1000),
?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop_nodedown),
@@ -1023,9 +1023,9 @@ two_grp(Config) when is_list(Config) ->
{wait_nodedown, Cpz}]),
?line PidX = rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test,
{wait_nodedown, Cpz}]),
- ?line test_server:sleep(100),
+ ct:sleep(100),
?line stop_node(Cpz),
- ?line test_server:sleep(1000),
+ ct:sleep(1000),
?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop_nodedown),
?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
@@ -1038,9 +1038,9 @@ two_grp(Config) when is_list(Config) ->
{wait_nodeup, Cp1}]),
?line PidX = rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test,
{wait_nodeup, Cp1}]),
- ?line test_server:sleep(100),
+ ct:sleep(100),
?line {ok, Cp1} = start_node(Ncp1, Config),
- ?line test_server:sleep(5000),
+ ct:sleep(5000),
?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop),
?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop_nodeup),
@@ -1053,9 +1053,9 @@ two_grp(Config) when is_list(Config) ->
{wait_nodeup, Cpz}]),
?line PidX = rpc:call(Cpx, global_group, send, [{node, Cpxnn}, test,
{wait_nodeup, Cpz}]),
- ?line test_server:sleep(100),
+ ct:sleep(100),
?line {ok, Cpz} = start_node(Ncpz, Config),
- ?line test_server:sleep(5000),
+ ct:sleep(5000),
?line ok = assert_loop(Cp2, Cp2nn, test2, Pid2, loop_nodeup),
?line ok = assert_loop(Cpx, Cpxnn, test, PidX, loop),
@@ -1097,7 +1097,7 @@ hidden_groups(Config) when is_list(Config) ->
?line {ok, Cpq} = start_node(Ncpq, Config),
% sleep a while to make the global_groups to sync...
- test_server:sleep(1000),
+ ct:sleep(1000),
% check the global group names
?line {nc1, [nc2, nc3]} = rpc:call(Cp1, global_group, global_groups, []),
@@ -1159,7 +1159,7 @@ test_exit(Config) when is_list(Config) ->
?line {ok, Cp2} = start_node(cp2, Config),
?line {ok, Cp3} = start_node(cp3, Config),
- test_server:sleep(1000),
+ ct:sleep(1000),
?line {error, illegal_function_call} =
rpc:call(Cp1, global_group, registered_names_test, [{node, Cp1nn}]),
@@ -1173,7 +1173,7 @@ test_exit(Config) when is_list(Config) ->
stop_node(Cp3),
% sleep to let the nodes die
- test_server:sleep(1000),
+ ct:sleep(1000),
ok.
diff --git a/lib/kernel/test/heart_SUITE.erl b/lib/kernel/test/heart_SUITE.erl
index 6eb77a673f..aa25a77aa8 100644
--- a/lib/kernel/test/heart_SUITE.erl
+++ b/lib/kernel/test/heart_SUITE.erl
@@ -126,7 +126,7 @@ start(Config) when is_list(Config) ->
{nodedown, Node} -> ok
after 2000 -> ct:fail(node_not_closed)
end,
- test_server:sleep(5000),
+ timer:sleep(5000),
case net_adm:ping(Node) of
pang ->
ok;
@@ -161,7 +161,7 @@ restart(Config) when is_list(Config) ->
after 2000 ->
ct:fail(node_not_closed)
end,
- test_server:sleep(5000),
+ timer:sleep(5000),
node_check_up_down(Node, 2000),
loose_node:stop(Node).
@@ -183,7 +183,7 @@ reboot(Config) when is_list(Config) ->
after 2000 ->
ct:fail(node_not_closed)
end,
- test_server:sleep(5000),
+ timer:sleep(5000),
node_check_up_down(Node, 2000),
ok.
@@ -234,7 +234,7 @@ node_start_immediately_after_crash_test(Config) when is_list(Config) ->
%% and in about 10 s. on solaris (carcharoth)
after (15000*test_server:timetrap_scale_factor()) -> ct:fail(node_not_closed)
end,
- test_server:sleep(3000),
+ timer:sleep(3000),
node_check_up_down(Node, 2000),
loose_node:stop(Node).
@@ -279,7 +279,7 @@ node_start_soon_after_crash_test(Config) when is_list(Config) ->
receive {nodedown, Node} -> ok
after (15000*test_server:timetrap_scale_factor()) -> ct:fail(node_not_closed)
end,
- test_server:sleep(20000),
+ timer:sleep(20000),
node_check_up_down(Node, 15000),
loose_node:stop(Node).
@@ -326,7 +326,7 @@ clear_cmd(Config) when is_list(Config) ->
after 2000 ->
ct:fail(node_not_closed)
end,
- test_server:sleep(5000),
+ timer:sleep(5000),
case net_adm:ping(Node) of
pong ->
erlang:monitor_node(Node, true);
@@ -343,7 +343,7 @@ clear_cmd(Config) when is_list(Config) ->
after 2000 ->
ct:fail(node_not_closed)
end,
- test_server:sleep(5000),
+ timer:sleep(5000),
case net_adm:ping(Node) of
pang ->
ok;
diff --git a/lib/kernel/test/init_SUITE.erl b/lib/kernel/test/init_SUITE.erl
index 926bf525c7..a1f92546d0 100644
--- a/lib/kernel/test/init_SUITE.erl
+++ b/lib/kernel/test/init_SUITE.erl
@@ -440,7 +440,7 @@ wait_restart(N, Node) ->
case net_adm:ping(Node) of
pong -> ok;
_ ->
- ?t:sleep(1000),
+ ct:sleep(1000),
wait_restart(N - 1, Node)
end.
@@ -482,7 +482,7 @@ reboot(Config) when is_list(Config) ->
stop_node(Node),
ct:fail(not_stopping)
end,
- ?t:sleep(5000),
+ ct:sleep(5000),
?line case net_adm:ping(Node) of
pang ->
ok;
@@ -509,7 +509,7 @@ stop(Config) when is_list(Config) ->
stop_node(Node),
ct:fail(not_stopping)
end,
- ?t:sleep(5000),
+ ct:sleep(5000),
?line case net_adm:ping(Node) of
pang ->
ok;
diff --git a/lib/kernel/test/kernel_config_SUITE.erl b/lib/kernel/test/kernel_config_SUITE.erl
index 78c3b9097b..13ab1ed8ba 100644
--- a/lib/kernel/test/kernel_config_SUITE.erl
+++ b/lib/kernel/test/kernel_config_SUITE.erl
@@ -89,7 +89,7 @@ sync(Conf) when is_list(Conf) ->
io:format("Command: ~s", [Command]),
?line open_port({spawn, Command}, [stream]),
io:format("started~n"),
- ?line ?t:sleep(12000),
+ ct:sleep(12000),
io:format("waited12~n"),
?line Host = from($@, atom_to_list(node())),
?line Cp1 = list_to_atom("cp1@"++Host),
diff --git a/lib/kernel/test/os_SUITE.erl b/lib/kernel/test/os_SUITE.erl
index 2121b2a447..db63a3103e 100644
--- a/lib/kernel/test/os_SUITE.erl
+++ b/lib/kernel/test/os_SUITE.erl
@@ -84,7 +84,7 @@ space_in_cwd(Config) when is_list(Config) ->
ct:fail({unexpected, Other})
end,
- ?t:sleep(5),
+ ct:sleep(5),
?line [] = receive_all(),
ok.
@@ -101,7 +101,7 @@ quoting(Config) when is_list(Config) ->
?line comp("x::one two", os:cmd(Echo ++ " x \"one two\"")),
?line comp("one two::y", os:cmd(Echo ++ " \"one two\" y")),
?line comp("x::::y", os:cmd(Echo ++ " x \"\" y")),
- ?t:sleep(5),
+ ct:sleep(5),
?line [] = receive_all(),
ok.
@@ -115,7 +115,7 @@ cmd_unicode(Config) when is_list(Config) ->
?line comp("one", os:cmd(Echo ++ " one")),
?line comp("one::two", os:cmd(Echo ++ " one two")),
?line comp("åäö::ϼΩ", os:cmd(Echo ++ " åäö " ++ [1020, 937])),
- ?t:sleep(5),
+ ct:sleep(5),
?line [] = receive_all(),
ok.
@@ -158,7 +158,7 @@ space_in_name(Config) when is_list(Config) ->
end,
?line comp("", os:cmd(Quote ++ Echo ++ Quote)),
?line comp("a::b::c", os:cmd(Quote ++ Echo ++ Quote ++ " a b c")),
- ?t:sleep(5),
+ ct:sleep(5),
?line [] = receive_all(),
ok.
@@ -257,7 +257,7 @@ unix_comment_in_command(Config) when is_list(Config) ->
Priv = proplists:get_value(priv_dir, Config),
?line ok = file:set_cwd(Priv),
?line _ = os:cmd("ls #"), % Any result is ok.
- ?t:sleep(5),
+ ct:sleep(5),
?line [] = receive_all(),
ok.
diff --git a/lib/kernel/test/pg2_SUITE.erl b/lib/kernel/test/pg2_SUITE.erl
index 703cca5aec..8ed54b7d0f 100644
--- a/lib/kernel/test/pg2_SUITE.erl
+++ b/lib/kernel/test/pg2_SUITE.erl
@@ -606,7 +606,7 @@ start_nodes2([Name | Rest], How, N, Config) ->
Self ! {N, R},
%% sleeping is necessary, or with peer nodes, they will
%% go down again, despite {linked, false}.
- test_server:sleep(100000)
+ ct:sleep(100000)
end),
start_nodes2(Rest, How, N+1, Config).
diff --git a/lib/kernel/test/prim_file_SUITE.erl b/lib/kernel/test/prim_file_SUITE.erl
index 05da66e6a6..92d44c8880 100644
--- a/lib/kernel/test/prim_file_SUITE.erl
+++ b/lib/kernel/test/prim_file_SUITE.erl
@@ -927,7 +927,7 @@ file_info_int(Config, Handle, Suffix) ->
%% Sleep until we can be sure the seconds value has changed.
%% Note: FAT-based filesystem (like on Windows 95) have
%% a resolution of 2 seconds.
- ?line test_server:sleep(test_server:seconds(2.2)),
+ ct:sleep({seconds,2.2}),
%% close the file, and watch the modify date change
?line ok = ?PRIM_FILE:close(Fd1),
diff --git a/lib/kernel/test/rpc_SUITE.erl b/lib/kernel/test/rpc_SUITE.erl
index b45e6bdb59..0b03079c37 100644
--- a/lib/kernel/test/rpc_SUITE.erl
+++ b/lib/kernel/test/rpc_SUITE.erl
@@ -138,9 +138,9 @@ multicall_timeout(Config) when is_list(Config) ->
?line {ok, N4} = ?t:start_node('2_rcp_SUITE_multicall', slave,
[{args, "-pa " ++ PA}]),
?line ok = io:format("~p~n", [[N1, N2]]),
- ?line {[{hej,_,N3},{hej,_,N4}],[N1, N2]} =
- rpc:multicall([N3, N1, N2, N4], ?MODULE, f, [], ?t:seconds(6)),
- ?t:sleep(?t:seconds(8)), %% Wait for late answers
+ {[{hej,_,N3},{hej,_,N4}],[N1, N2]} =
+ rpc:multicall([N3, N1, N2, N4], ?MODULE, f, [], 6000),
+ ct:sleep({seconds,8}), %Wait for late answers
?line Msgs = flush([]),
?line [] = Msgs,
?line ?t:stop_node(N1),
@@ -481,7 +481,7 @@ async_call(Config) when is_list(Config) ->
?line timeout = rpc:nb_yield(Promise2, 10),
%% Let Node1 finish its work before yielding.
- ?t:sleep(?t:seconds(2)),
+ ct:sleep({seconds,2}),
?line {hej,_,Node1} = rpc:yield(Promise1),
%% Wait for the Node2 and Node3.