mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 01:22:04 +00:00
add multithreaded test
This commit is contained in:
parent
90d019a281
commit
c38a690e8e
@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
import time
|
||||
import threading
|
||||
from os import path as p, unlink
|
||||
from tempfile import NamedTemporaryFile
|
||||
|
||||
@ -174,6 +175,17 @@ def test_secure_connection():
|
||||
assert node1.query("SELECT count() FROM system.zookeeper WHERE path = '/'") == '2\n'
|
||||
assert node2.query("SELECT count() FROM system.zookeeper WHERE path = '/'") == '2\n'
|
||||
|
||||
|
||||
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)])))
|
||||
|
||||
for thread in threads:
|
||||
thread.join()
|
||||
|
||||
finally:
|
||||
cluster.shutdown()
|
||||
unlink(docker_compose.name)
|
||||
|
Loading…
Reference in New Issue
Block a user