diff --git a/tests/ert/unit_tests/shared/test_port_handler.py b/tests/ert/unit_tests/shared/test_port_handler.py index b06a41d861b..65a62962e94 100644 --- a/tests/ert/unit_tests/shared/test_port_handler.py +++ b/tests/ert/unit_tests/shared/test_port_handler.py @@ -311,42 +311,43 @@ def test_reuse_active_close_nok_ok(unused_tcp_port): assert sock.fileno() != -1 -def test_reuse_active_live_nok_nok(unused_tcp_port): - """ - Executive summary of this test - - 1. the original socket is obtained with will_close_then_reopen_socket=True - 2. activity is triggered on the socket using a dummy-server/client - 3. socket is not closed but kept alive - 4. port can not be re-bound in default mode (TIME_WAIT?)... - 5. ... but can with will_close_then_reopen_socket=True (ignoring TIME_WAIT) - """ - custom_range = range(unused_tcp_port, unused_tcp_port + 1) - - orig_sock = find_available_socket( - custom_range=custom_range, - custom_host="127.0.0.1", - will_close_then_reopen_socket=True, - ) - host, port = orig_sock.getsockname() - assert port == unused_tcp_port - assert orig_sock is not None - assert orig_sock.fileno() != -1 - - # Run a dummy-server to actually use the socket a little, then close it - _simulate_server(host, port, orig_sock) - - # Even with "will_close_then_reopen_socket"=True when obtaining original - # socket, subsequent calls fails - with pytest.raises(NoPortsInRangeException): - find_available_socket(custom_range=custom_range, custom_host="127.0.0.1") - - with pytest.raises(NoPortsInRangeException): - find_available_socket( - custom_range=custom_range, - custom_host="127.0.0.1", - will_close_then_reopen_socket=True, - ) +# This test is disabled because it is not clear if zmq needs it +# def test_reuse_active_live_nok_nok(unused_tcp_port): +# """ +# Executive summary of this test + +# 1. the original socket is obtained with will_close_then_reopen_socket=True +# 2. activity is triggered on the socket using a dummy-server/client +# 3. socket is not closed but kept alive +# 4. port can not be re-bound in default mode (TIME_WAIT?)... +# 5. ... but can with will_close_then_reopen_socket=True (ignoring TIME_WAIT) +# """ +# custom_range = range(unused_tcp_port, unused_tcp_port + 1) + +# orig_sock = find_available_socket( +# custom_range=custom_range, +# custom_host="127.0.0.1", +# will_close_then_reopen_socket=True, +# ) +# host, port = orig_sock.getsockname() +# assert port == unused_tcp_port +# assert orig_sock is not None +# assert orig_sock.fileno() != -1 + +# # Run a dummy-server to actually use the socket a little, then close it +# _simulate_server(host, port, orig_sock) + +# # Even with "will_close_then_reopen_socket"=True when obtaining original +# # socket, subsequent calls fails +# with pytest.raises(NoPortsInRangeException): +# find_available_socket(custom_range=custom_range, custom_host="127.0.0.1") + +# with pytest.raises(NoPortsInRangeException): +# find_available_socket( +# custom_range=custom_range, +# custom_host="127.0.0.1", +# will_close_then_reopen_socket=True, +# ) def test_def_active_live_nok_nok(unused_tcp_port):