aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src/ct_util.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2013-05-24 12:06:16 +0200
committerSiri Hansen <[email protected]>2013-05-24 15:44:48 +0200
commit28f3a4a5713487cb6ade48f2d142d8c2d5b7ac6e (patch)
tree61a05a0fa71e43f05250fe060a3c7eab612d50f0 /lib/common_test/src/ct_util.erl
parent01eb20066918e107811d01f43b97e3925f894dbd (diff)
downloadotp-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/src/ct_util.erl')
-rw-r--r--lib/common_test/src/ct_util.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/common_test/src/ct_util.erl b/lib/common_test/src/ct_util.erl
index 6a8b37bf3b..b77845eb5b 100644
--- a/lib/common_test/src/ct_util.erl
+++ b/lib/common_test/src/ct_util.erl
@@ -421,6 +421,8 @@ loop(Mode,TestData,StartDir) ->
"Reason: ~p\n\n",
[Pid,A,CB,Reason]),
catch CB:close(Pid),
+ %% in case CB:close failed to do this:
+ unregister_connection(Pid),
loop(Mode,TestData,StartDir);
_ ->
%% Let process crash in case of error, this shouldn't happen!