Skip to content

Commit

Permalink
tests/integration: add workaround for a bug in kazoo driver
Browse files Browse the repository at this point in the history
Refs: python-zk/kazoo#688
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
  • Loading branch information
azat committed Dec 28, 2022
1 parent e1ad5ce commit bc6adc8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/integration/test_keeper_auth/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
import time
from helpers.cluster import ClickHouseCluster
from kazoo.client import KazooClient, KazooState
from kazoo.security import ACL, make_digest_acl, make_acl
Expand Down Expand Up @@ -162,6 +163,13 @@ def test_digest_auth_basic(started_cluster, get_zk):
with pytest.raises(AuthFailedError):
no_auth_connection.add_auth("world", "anyone")

# FIXME: this sleep is a workaround for the bug that is fixed by this patch [1].
#
# The problem is that after AUTH_FAILED (that is caused by the line above)
# there can be a race, because of which, stop() will hang indefinitely.
#
# [1]: https://github.com/python-zk/kazoo/pull/688
time.sleep(5)
no_auth_connection.stop()
# session became broken, reconnect
no_auth_connection = get_zk()
Expand Down

0 comments on commit bc6adc8

Please sign in to comment.