add multithreaded test

This commit is contained in:
Nikita Mikhaylov 2021-03-04 16:07:40 +03:00
parent 90d019a281
commit c38a690e8e

View File

@ -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)