File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -278,7 +278,7 @@ def _next_afi_host_port(self):
278
278
279
279
def connect (self ):
280
280
"""Attempt to connect and return ConnectionState"""
281
- if self .state is ConnectionStates .DISCONNECTED :
281
+ if self .state is ConnectionStates .DISCONNECTED and not self . blacked_out () :
282
282
self .last_attempt = time .time ()
283
283
next_lookup = self ._next_afi_host_port ()
284
284
if not next_lookup :
Original file line number Diff line number Diff line change @@ -263,6 +263,7 @@ def test_lookup_on_connect():
263
263
]
264
264
265
265
with mock .patch ("socket.getaddrinfo" , return_value = mock_return2 ) as m :
266
+ conn .last_attempt = 0
266
267
conn .connect ()
267
268
m .assert_called_once_with (hostname , port , 0 , 1 )
268
269
conn .close ()
@@ -288,6 +289,7 @@ def test_relookup_on_failure():
288
289
]
289
290
290
291
with mock .patch ("socket.getaddrinfo" , return_value = mock_return2 ) as m :
292
+ conn .last_attempt = 0
291
293
conn .connect ()
292
294
m .assert_called_once_with (hostname , port , 0 , 1 )
293
295
conn .close ()
You can’t perform that action at this time.
0 commit comments