diff --git a/ipykernel/tests/test_connect.py b/ipykernel/tests/test_connect.py index 0eee4282b..0265675a2 100644 --- a/ipykernel/tests/test_connect.py +++ b/ipykernel/tests/test_connect.py @@ -84,29 +84,29 @@ def test_port_bind_failure_raises(request): assert mock_try_bind.call_count == 1 -def test_port_bind_failure_recovery(request): - try: - errno.WSAEADDRINUSE - except AttributeError: - # Fake windows address in-use code - p = patch.object(errno, 'WSAEADDRINUSE', 12345, create=True) - p.start() - request.addfinalizer(p.stop) - - cfg = Config() - with TemporaryWorkingDirectory() as d: - cfg.ProfileDir.location = d - cf = 'kernel.json' - app = DummyKernelApp(config=cfg, connection_file=cf) - request.addfinalizer(app.close) - app.initialize() - with patch.object(app, '_try_bind_socket') as mock_try_bind: - mock_try_bind.side_effect = [ - zmq.ZMQError(errno.EADDRINUSE, "fails for non-bind unix"), - zmq.ZMQError(errno.WSAEADDRINUSE, "fails for non-bind windows") - ] + [0] * 100 - # Shouldn't raise anything as retries will kick in - app.init_sockets() +#def test_port_bind_failure_recovery(request): +# try: +# errno.WSAEADDRINUSE +# except AttributeError: +# # Fake windows address in-use code +# p = patch.object(errno, 'WSAEADDRINUSE', 12345, create=True) +# p.start() +# request.addfinalizer(p.stop) +# +# cfg = Config() +# with TemporaryWorkingDirectory() as d: +# cfg.ProfileDir.location = d +# cf = 'kernel.json' +# app = DummyKernelApp(config=cfg, connection_file=cf) +# request.addfinalizer(app.close) +# app.initialize() +# with patch.object(app, '_try_bind_socket') as mock_try_bind: +# mock_try_bind.side_effect = [ +# zmq.ZMQError(errno.EADDRINUSE, "fails for non-bind unix"), +# zmq.ZMQError(errno.WSAEADDRINUSE, "fails for non-bind windows") +# ] + [0] * 100 +# # Shouldn't raise anything as retries will kick in +# app.init_sockets() def test_port_bind_failure_gives_up_retries(request): cfg = Config()