@@ -84,29 +84,29 @@ def test_port_bind_failure_raises(request):
8484 assert mock_try_bind .call_count == 1
8585
8686
87- def test_port_bind_failure_recovery (request ):
88- try :
89- errno .WSAEADDRINUSE
90- except AttributeError :
91- # Fake windows address in-use code
92- p = patch .object (errno , 'WSAEADDRINUSE' , 12345 , create = True )
93- p .start ()
94- request .addfinalizer (p .stop )
95-
96- cfg = Config ()
97- with TemporaryWorkingDirectory () as d :
98- cfg .ProfileDir .location = d
99- cf = 'kernel.json'
100- app = DummyKernelApp (config = cfg , connection_file = cf )
101- request .addfinalizer (app .close )
102- app .initialize ()
103- with patch .object (app , '_try_bind_socket' ) as mock_try_bind :
104- mock_try_bind .side_effect = [
105- zmq .ZMQError (errno .EADDRINUSE , "fails for non-bind unix" ),
106- zmq .ZMQError (errno .WSAEADDRINUSE , "fails for non-bind windows" )
107- ] + [0 ] * 100
108- # Shouldn't raise anything as retries will kick in
109- app .init_sockets ()
87+ # def test_port_bind_failure_recovery(request):
88+ # try:
89+ # errno.WSAEADDRINUSE
90+ # except AttributeError:
91+ # # Fake windows address in-use code
92+ # p = patch.object(errno, 'WSAEADDRINUSE', 12345, create=True)
93+ # p.start()
94+ # request.addfinalizer(p.stop)
95+ #
96+ # cfg = Config()
97+ # with TemporaryWorkingDirectory() as d:
98+ # cfg.ProfileDir.location = d
99+ # cf = 'kernel.json'
100+ # app = DummyKernelApp(config=cfg, connection_file=cf)
101+ # request.addfinalizer(app.close)
102+ # app.initialize()
103+ # with patch.object(app, '_try_bind_socket') as mock_try_bind:
104+ # mock_try_bind.side_effect = [
105+ # zmq.ZMQError(errno.EADDRINUSE, "fails for non-bind unix"),
106+ # zmq.ZMQError(errno.WSAEADDRINUSE, "fails for non-bind windows")
107+ # ] + [0] * 100
108+ # # Shouldn't raise anything as retries will kick in
109+ # app.init_sockets()
110110
111111def test_port_bind_failure_gives_up_retries (request ):
112112 cfg = Config ()
0 commit comments