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/src/ct_util.erl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/common_test/src/ct_util.erl') 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! -- cgit v1.2.3