File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -258,7 +258,7 @@ def back(state):
258
258
class TestReadOnlyMode (KazooTestCase ):
259
259
def setUp (self ):
260
260
os .environ ["ZOOKEEPER_LOCAL_SESSION_RO" ] = "true"
261
- self .setup_zookeeper (read_only = True )
261
+ self .setup_zookeeper ()
262
262
skip = False
263
263
if CI_ZK_VERSION and CI_ZK_VERSION < (3 , 4 ):
264
264
skip = True
@@ -278,8 +278,10 @@ def tearDown(self):
278
278
def test_read_only (self ):
279
279
from kazoo .exceptions import NotReadOnlyCallError
280
280
from kazoo .protocol .states import KeeperState
281
+ from kazoo .retry import KazooRetry
281
282
282
- client = self .client
283
+ conn_retry = KazooRetry (max_tries = 50 , delay = 0.5 , max_delay = 180 )
284
+ client = self ._get_client (connection_retry = conn_retry , read_only = True )
283
285
states = []
284
286
ev = threading .Event ()
285
287
@@ -289,6 +291,7 @@ def listen(state):
289
291
if client .client_state == KeeperState .CONNECTED_RO :
290
292
ev .set ()
291
293
294
+ client .start ()
292
295
try :
293
296
# stopping both nodes at the same time
294
297
# else the test seems flaky when on CI hosts
Original file line number Diff line number Diff line change @@ -114,11 +114,11 @@ module = [
114
114
' kazoo.testing.common' ,
115
115
' kazoo.testing.harness' ,
116
116
' kazoo.tests.conftest' ,
117
- ' kazoo.tests.test__connection' ,
118
117
' kazoo.tests.test_barrier' ,
119
118
' kazoo.tests.test_build' ,
120
119
' kazoo.tests.test_cache' ,
121
120
' kazoo.tests.test_client' ,
121
+ ' kazoo.tests.test_connection' ,
122
122
' kazoo.tests.test_counter' ,
123
123
' kazoo.tests.test_election' ,
124
124
' kazoo.tests.test_eventlet_handler' ,
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ allowlist_externals =
36
36
commands =
37
37
sasl: {toxinidir}/init_krb5.sh {envtmpdir}/kerberos \
38
38
{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 }
40
40
41
41
[testenv:build]
42
42
You can’t perform that action at this time.
0 commit comments