diff options
author | Siri Hansen <[email protected]> | 2012-08-17 11:40:48 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2012-08-17 11:40:48 +0200 |
commit | f11a10e75d7f3b49a58ac225d624ac6654e23870 (patch) | |
tree | c4ee2b182adab901a2f3f8aec29e6b1badd2fcca /lib/common_test/src/ct_util.erl | |
parent | 9125e9158a7547e51c94276aec6b98e9424c0c68 (diff) | |
parent | bc8f2b83132c30f88699b555cc7ffb79d8018ac2 (diff) | |
download | otp-f11a10e75d7f3b49a58ac225d624ac6654e23870.tar.gz otp-f11a10e75d7f3b49a58ac225d624ac6654e23870.tar.bz2 otp-f11a10e75d7f3b49a58ac225d624ac6654e23870.zip |
Merge branch 'siri/common_test/ct_netconfc/OTP-10025' into maint
* siri/common_test/ct_netconfc/OTP-10025:
[common_test] Move ct_netconfc_SUITE into datadir and run with ct_test_support
[common_test] Don't abort test if opening of connection fails
[common_test] Don't allow named (required) connection to be opened twice
[common_test] Don't abort test run if connection process crashes
[common_test] Add netconf client, ct_netconfc
Diffstat (limited to 'lib/common_test/src/ct_util.erl')
-rw-r--r-- | lib/common_test/src/ct_util.erl | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/lib/common_test/src/ct_util.erl b/lib/common_test/src/ct_util.erl index 9d6ee3c8b9..66ecb142ca 100644 --- a/lib/common_test/src/ct_util.erl +++ b/lib/common_test/src/ct_util.erl @@ -369,11 +369,23 @@ loop(Mode,TestData,StartDir) -> {'EXIT',_Pid,normal} -> loop(Mode,TestData,StartDir); {'EXIT',Pid,Reason} -> - %% Let process crash in case of error, this shouldn't happen! - io:format("\n\nct_util_server got EXIT from ~p: ~p\n\n", - [Pid,Reason]), - file:set_cwd(StartDir), - exit(Reason) + case ets:lookup(?conn_table,Pid) of + [#conn{address=A,callback=CB}] -> + %% A connection crashed - remove the connection but don't die + ct_logs:tc_log_async(ct_error_notify, + "Connection process died: " + "Pid: ~p, Address: ~p, Callback: ~p\n" + "Reason: ~p\n\n", + [Pid,A,CB,Reason]), + catch CB:close(Pid), + loop(Mode,TestData,StartDir); + _ -> + %% Let process crash in case of error, this shouldn't happen! + io:format("\n\nct_util_server got EXIT from ~p: ~p\n\n", + [Pid,Reason]), + file:set_cwd(StartDir), + exit(Reason) + end end. |