File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -258,7 +258,7 @@ def back(state):
258258class TestReadOnlyMode (KazooTestCase ):
259259 def setUp (self ):
260260 os .environ ["ZOOKEEPER_LOCAL_SESSION_RO" ] = "true"
261- self .setup_zookeeper (read_only = True )
261+ self .setup_zookeeper ()
262262 skip = False
263263 if CI_ZK_VERSION and CI_ZK_VERSION < (3 , 4 ):
264264 skip = True
@@ -278,8 +278,13 @@ def tearDown(self):
278278 def test_read_only (self ):
279279 from kazoo .exceptions import NotReadOnlyCallError
280280 from kazoo .protocol .states import KeeperState
281+ from kazoo .retry import KazooRetry
281282
282- client = self .client
283+ conn_retry = KazooRetry (max_tries = 10 , delay = 0.2 )
284+ client = self ._get_client (
285+ connection_retry = conn_retry ,
286+ read_only = True
287+ )
283288 states = []
284289 ev = threading .Event ()
285290
@@ -289,6 +294,7 @@ def listen(state):
289294 if client .client_state == KeeperState .CONNECTED_RO :
290295 ev .set ()
291296
297+ client .start ()
292298 try :
293299 # stopping both nodes at the same time
294300 # else the test seems flaky when on CI hosts
Original file line number Diff line number Diff line change @@ -114,11 +114,11 @@ module = [
114114 ' kazoo.testing.common' ,
115115 ' kazoo.testing.harness' ,
116116 ' kazoo.tests.conftest' ,
117- ' kazoo.tests.test__connection' ,
118117 ' kazoo.tests.test_barrier' ,
119118 ' kazoo.tests.test_build' ,
120119 ' kazoo.tests.test_cache' ,
121120 ' kazoo.tests.test_client' ,
121+ ' kazoo.tests.test_connection' ,
122122 ' kazoo.tests.test_counter' ,
123123 ' kazoo.tests.test_election' ,
124124 ' kazoo.tests.test_eventlet_handler' ,
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ allowlist_externals =
3636commands =
3737 sasl: {toxinidir}/init_krb5.sh {envtmpdir}/kerberos \
3838 {toxinidir}/ensure-zookeeper-env.sh \
39- pytest {posargs: -ra -v --cov-report =xml --cov =kazoo kazoo/tests}
39+ pytest {posargs: -ra -v --cov-report =xml --cov =kazoo kazoo/tests/test_connection.py }
4040
4141[testenv:build]
4242
You can’t perform that action at this time.
0 commit comments