Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance tck setup #3580

Merged
merged 3 commits into from
Dec 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 24 additions & 11 deletions tests/common/nebula_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ def start(self):
for p in self.all_processes:
p.start()

time.sleep(3)
config = Config()
config.max_connection_pool_size = 20
config.timeout = 60000
Expand All @@ -377,19 +376,33 @@ def start(self):
# assert client_pool.init([("127.0.0.1", int(self.graphd_port))], config)
ssl_config = get_ssl_config(self.is_graph_ssl, self.ca_signed)
print("begin to add hosts")
assert client_pool.init(
[("127.0.0.1", self.graphd_processes[0].tcp_port)], config, ssl_config
)

cmd = (
"ADD HOSTS 127.0.0.1:"
+ str(self.storaged_processes[0].tcp_port)
+ " INTO NEW ZONE \"default_zone\""
)
print("add hosts cmd is {}".format(cmd))
ok = False
# wait graph is ready, and then add hosts
for _ in range(20):
try:
ok = client_pool.init(
[("127.0.0.1", self.graphd_processes[0].tcp_port)],
config,
ssl_config,
)
if ok:
break
except:
pass
time.sleep(1)

assert ok, "graph is not ready"
# get session from the pool
client = client_pool.get_session('root', 'nebula')

hosts = ",".join(
[
"127.0.0.1:{}".format(str(storaged.tcp_port))
for storaged in self.storaged_processes
]
)
cmd = "ADD HOSTS {} INTO NEW ZONE \"default_zone\"".format(hosts)
print("add hosts cmd is {}".format(cmd))
resp = client.execute(cmd)
assert resp.is_succeeded(), resp.error_msg()
client.release()
Expand Down