From 4469c7d0cb3ba5d3c404ebd13097072d8b531091 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Tue, 26 Feb 2013 15:31:47 +0100 Subject: [observer] Kill slave node between tests in etop_SUITE To avoid that the second test case fails (due to duplicate name) if the first fails - always kill the slave node after each test case. --- lib/observer/test/etop_SUITE.erl | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'lib/observer/test') diff --git a/lib/observer/test/etop_SUITE.erl b/lib/observer/test/etop_SUITE.erl index 06577f82cc..6ce3ea59cf 100644 --- a/lib/observer/test/etop_SUITE.erl +++ b/lib/observer/test/etop_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2012. All Rights Reserved. +%% Copyright Ericsson AB 2002-2013. 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 @@ -21,7 +21,8 @@ %% Test functions -export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, - init_per_group/2,end_per_group/2,text/1,text_tracing_off/1]). + init_per_group/2,end_per_group/2]). +-export([text/1,text/2,text_tracing_off/1,text_tracing_off/2]). -export([init_per_testcase/2, end_per_testcase/2]). -include_lib("test_server/include/test_server.hrl"). @@ -31,7 +32,10 @@ init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), [{watchdog, Dog}|Config]. -end_per_testcase(_Case, Config) -> +end_per_testcase(Case, Config) -> + try apply(?MODULE,Case,[cleanup,Config]) + catch error:undef -> ok + end, Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. @@ -82,9 +86,12 @@ text() -> ?line timer:sleep(3000), ?line etop:config(sort,msg_q), ?line timer:sleep(3000), - ?line etop:stop(), - ?line ?t:stop_node(Node), ok. +text(cleanup,_Config) -> + etop:stop(), + {ok,Host} = inet:gethostname(), + Node = list_to_atom("node2@"++Host), + ?t:stop_node(Node). text_tracing_off(suite) -> []; @@ -111,7 +118,10 @@ text_tracing_off(Config) when is_list(Config) -> ?line timer:sleep(3000), ?line etop:config(sort,runtime), % this should not crash, but has no effect ?line timer:sleep(3000), - ?line etop:stop(), - ?line ?t:stop_node(Node), ok. +text_tracing_off(cleanup,_Config) -> + etop:stop(), + {ok,Host} = inet:gethostname(), + Node = list_to_atom("node2@"++Host), + ?t:stop_node(Node). -- cgit v1.2.3 From 6ab4b1c2a7a5a89dd8ea4094bd7fb4c23745acfc Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Tue, 26 Feb 2013 15:36:52 +0100 Subject: [observer] Extend timer to allow trace msgs to arrive over tcp/ip Some tests fail (mostly on windows) every now and then with too few trace messages in log. Extending the timer from 200 to 500 ms to see if this is the reason. Plus removing a compiler warning in ttb_SUITE. --- lib/observer/test/ttb_SUITE.erl | 5 +++-- lib/observer/test/ttb_helper.erl | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/observer/test') diff --git a/lib/observer/test/ttb_SUITE.erl b/lib/observer/test/ttb_SUITE.erl index 695d41b48a..f3fcd9f283 100644 --- a/lib/observer/test/ttb_SUITE.erl +++ b/lib/observer/test/ttb_SUITE.erl @@ -1,7 +1,8 @@ +%% %% %CopyrightBegin% %% %% -%% Copyright Ericsson AB 2002-2010. All Rights Reserved. +%% Copyright Ericsson AB 2002-2013. 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 @@ -57,7 +58,7 @@ init_per_testcase(Case, Config) -> catch error:undef -> ok end, [{watchdog, Dog}|Config]. -end_per_testcase(Case, Config) -> +end_per_testcase(_Case, Config) -> %% try apply(?MODULE,Case,[cleanup,Config]) %% catch error:undef -> ok %% end, diff --git a/lib/observer/test/ttb_helper.erl b/lib/observer/test/ttb_helper.erl index 76b06cd3ce..05f6d73aef 100644 --- a/lib/observer/test/ttb_helper.erl +++ b/lib/observer/test/ttb_helper.erl @@ -70,7 +70,7 @@ msgs(N) -> msgs_ip(N) -> [c(client, put, [test_msg]) || _ <- lists:seq(1, N)], s(server, received, [a,b]), - timer:sleep(200). %% allow trace messages to arrive over tcp/ip + timer:sleep(500). %% allow trace messages to arrive over tcp/ip run() -> ttb({local, "A"}), -- cgit v1.2.3