diff options
author | Siri Hansen <[email protected]> | 2013-05-24 12:06:16 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2013-05-24 15:44:48 +0200 |
commit | 28f3a4a5713487cb6ade48f2d142d8c2d5b7ac6e (patch) | |
tree | 61a05a0fa71e43f05250fe060a3c7eab612d50f0 /lib/common_test/test/ct_telnet_SUITE.erl | |
parent | 01eb20066918e107811d01f43b97e3925f894dbd (diff) | |
download | otp-28f3a4a5713487cb6ade48f2d142d8c2d5b7ac6e.tar.gz otp-28f3a4a5713487cb6ade48f2d142d8c2d5b7ac6e.tar.bz2 otp-28f3a4a5713487cb6ade48f2d142d8c2d5b7ac6e.zip |
[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.
Diffstat (limited to 'lib/common_test/test/ct_telnet_SUITE.erl')
-rw-r--r-- | lib/common_test/test/ct_telnet_SUITE.erl | 15 |
1 files changed, 13 insertions, 2 deletions
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), |