mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 00:52:02 +00:00
Merge pull request #28066 from ClickHouse/fix_zookeeper_secure_test
Fix zookeeper secure client test
This commit is contained in:
commit
167d34051c
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user