aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2013-04-23 11:30:06 +0200
committerAnders Svensson <[email protected]>2013-04-23 11:33:51 +0200
commit87340609df5c1b7e8d28b4bb70356bcfbc258ab2 (patch)
tree687b9998f3484c7fe17c19bf2d90db5999299b72
parent439a579e79bc334dc38dfe905c53957cbaefc499 (diff)
downloadotp-87340609df5c1b7e8d28b4bb70356bcfbc258ab2.tar.gz
otp-87340609df5c1b7e8d28b4bb70356bcfbc258ab2.tar.bz2
otp-87340609df5c1b7e8d28b4bb70356bcfbc258ab2.zip
Add examples testcase to help identify timetrap failures
There are still enslave/1 failures on some hosts despite a 2 minute timetrap.
-rw-r--r--lib/diameter/test/diameter_examples_SUITE.erl25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/diameter/test/diameter_examples_SUITE.erl b/lib/diameter/test/diameter_examples_SUITE.erl
index 98b280f1a4..1954bc319b 100644
--- a/lib/diameter/test/diameter_examples_SUITE.erl
+++ b/lib/diameter/test/diameter_examples_SUITE.erl
@@ -29,6 +29,7 @@
%% testcases
-export([dict/1, dict/0,
code/1,
+ slave/1, slave/0,
enslave/1,
start/1,
traffic/1,
@@ -70,6 +71,7 @@ suite() ->
all() ->
[dict,
code,
+ slave,
enslave,
start,
traffic,
@@ -250,6 +252,29 @@ store(Path, Dict) ->
%% ===========================================================================
+%% slave/1
+%%
+%% Return how long slave start/stop is taking since it seems to be
+%% ridiculously long on some hosts.
+
+slave() ->
+ [{timetrap, {minutes, 10}}].
+
+slave(_) ->
+ T0 = now(),
+ {ok, Node} = ct_slave:start(?MODULE, ?TIMEOUTS),
+ T1 = now(),
+ T2 = rpc:call(Node, erlang, now, []),
+ {ok, Node} = ct_slave:stop(?MODULE),
+ now_diff([T0, T1, T2, now()]).
+
+now_diff([T1,T2|_] = Ts) ->
+ [timer:now_diff(T2,T1) | now_diff(tl(Ts))];
+now_diff(_) ->
+ [].
+
+%% ===========================================================================
+
%% enslave/1
%%
%% Start two nodes: one for the server, one for the client.