Fix zookeeper secure client test

This commit is contained in:
alesapin 2021-08-24 11:01:08 +03:00
parent 0858fdf113
commit 2d480b33b6

View File

@ -1,5 +1,3 @@
import threading
import os
from tempfile import NamedTemporaryFile
@ -35,18 +33,21 @@ def started_cluster():
# NOTE this test have to be ported to Keeper
def test_secure_connection(started_cluster):
assert node1.query("SELECT count() FROM system.zookeeper WHERE path = '/'") == '2\n'
assert node2.query("SELECT count() FROM system.zookeeper WHERE path = '/'") == '2\n'
# no asserts, connection works
node1.query("SELECT count() FROM system.zookeeper WHERE path = '/'")
node2.query("SELECT count() FROM system.zookeeper WHERE path = '/'")
kThreadsNumber = 16
kIterations = 100
threads = []
for _ in range(kThreadsNumber):
threads.append(threading.Thread(target=(lambda:
[node1.query("SELECT count() FROM system.zookeeper WHERE path = '/'") for _ in range(kIterations)])))
threads_number = 16
iterations = 100
threads = []
for thread in threads:
thread.start()
# just checking for race conditions
for _ in range(threads_number):
threads.append(threading.Thread(target=(lambda:
[node1.query("SELECT count() FROM system.zookeeper WHERE path = '/'") for _ in range(iterations)])))
for thread in threads:
thread.join()
for thread in threads:
thread.start()
for thread in threads:
thread.join()