diff options
-rw-r--r-- | kazoo/protocol/connection.py | 2 | ||||
-rw-r--r-- | kazoo/tests/test_client.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/kazoo/protocol/connection.py b/kazoo/protocol/connection.py index 6ed5cde..9b5ce2f 100644 --- a/kazoo/protocol/connection.py +++ b/kazoo/protocol/connection.py @@ -619,7 +619,7 @@ class ConnectionHandler(object): self.ping_outstanding.clear() last_send = time.time() with self._socket_error_handling(): - while True: + while not self.client._stopped.is_set(): # Watch for something to read or send jitter_time = random.randint(1, 40) / 100.0 deadline = last_send + read_timeout / 2.0 - jitter_time diff --git a/kazoo/tests/test_client.py b/kazoo/tests/test_client.py index 2eba7b4..d05cacb 100644 --- a/kazoo/tests/test_client.py +++ b/kazoo/tests/test_client.py @@ -256,6 +256,8 @@ class TestAuthentication(KazooTestCase): with pytest.raises(AuthFailedError): client.add_auth("unknown-scheme", digest_auth) + client.stop() + def test_add_auth_on_reconnect(self): client = self._get_client() client.start() |