From 28f3a4a5713487cb6ade48f2d142d8c2d5b7ac6e Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Fri, 24 May 2013 12:06:16 +0200 Subject: [common_test] Unregister connection if killed The symptom of this bug was that a (named) telnet connection which was open and hanging during a timetrap timeout could no longer be opened again in subsequent test cases. Since the connection was hanging, ct_telnet:close/1 which was called during end_per_testcase would fail (timeout) and cause common_test to brutally kill the connection. The bug was that the connection was not unregistered at this point. When trying to open the connection again in the next testcase, common_test attempted to reuse the same connection since it had not been unregistered. This failed since the connection in fact was dead. --- lib/common_test/test/ct_telnet_SUITE.erl | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'lib/common_test/test/ct_telnet_SUITE.erl') diff --git a/lib/common_test/test/ct_telnet_SUITE.erl b/lib/common_test/test/ct_telnet_SUITE.erl index 17617f59eb..e2ee207754 100644 --- a/lib/common_test/test/ct_telnet_SUITE.erl +++ b/lib/common_test/test/ct_telnet_SUITE.erl @@ -72,7 +72,8 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [ unix_telnet, - own_server + own_server, + timetrap ]. %%-------------------------------------------------------------------- @@ -88,6 +89,10 @@ own_server(Config) -> all_tests_in_suite(own_server,"ct_telnet_own_server_SUITE", "telnet2.cfg",Config). +timetrap(Config) -> + all_tests_in_suite(timetrap,"ct_telnet_timetrap_SUITE", + "telnet3.cfg",Config). + %%%----------------------------------------------------------------- %%% HELP FUNCTIONS %%%----------------------------------------------------------------- @@ -143,7 +148,13 @@ telnet_config(_) -> events_to_check(unix_telnet,Config) -> all_cases(ct_telnet_basic_SUITE,Config); events_to_check(own_server,Config) -> - all_cases(ct_telnet_own_server_SUITE,Config). + all_cases(ct_telnet_own_server_SUITE,Config); +events_to_check(timetrap,_Config) -> + [{?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,tc_done,{ct_telnet_timetrap_SUITE,expect_timetrap, + {failed,{timetrap_timeout,7000}}}}, + {?eh,tc_done,{ct_telnet_timetrap_SUITE,expect_success,ok}}, + {?eh,stop_logging,[]}]. all_cases(Suite,Config) -> {module,_} = code:load_abs(filename:join(?config(data_dir,Config), -- cgit v1.2.3