Skip to content

Commit f182708

Browse files
committed
Update node failure tests to use kill instead segv
1 parent 17eff06 commit f182708

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

swarms/tests/node_failure.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def check_restart_clickhouse_on_swarm_node(
143143
self,
144144
minio_root_user,
145145
minio_root_password,
146-
row_count=100,
146+
row_count=1000,
147147
batch_size=100,
148148
cluster_name="static_swarm_cluster",
149149
node=None,
@@ -170,14 +170,14 @@ def check_restart_clickhouse_on_swarm_node(
170170
exitcode=32,
171171
message="DB::Exception: Attempt to read after eof",
172172
cluster_name=cluster_name,
173-
delay_before_execution=1,
173+
delay_before_execution=0,
174174
)
175175
Step(
176176
"restart clickhouse on random swarm node",
177177
test=actions.restart_clickhouse_on_random_swarm_node,
178178
parallel=True,
179179
executor=pool,
180-
)(delay=0.0)
180+
)(delay=30, signal="KILL", delay_before_execution=5)
181181
join()
182182

183183

@@ -457,8 +457,6 @@ def feature(self, minio_root_user, minio_root_password, node=None):
457457
Scenario(test=check_restart_clickhouse_on_swarm_node)(
458458
minio_root_user=minio_root_user,
459459
minio_root_password=minio_root_password,
460-
row_count=row_count,
461-
batch_size=batch_size,
462460
)
463461
Scenario(test=network_failure)(
464462
minio_root_user=minio_root_user,

swarms/tests/steps/swarm_node_actions.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ def restart_random_swarm_node(self, delay=None):
3939

4040

4141
@TestStep(Given)
42-
def restart_clickhouse_on_random_swarm_node(self, signal="SEGV", delay=None):
42+
def restart_clickhouse_on_random_swarm_node(
43+
self, signal="SEGV", delay=None, delay_before_execution=0
44+
):
4345
"""
4446
Send a kill signal to a random clickhouse swarm instance, wait, and restart.
4547
"""
@@ -48,8 +50,12 @@ def restart_clickhouse_on_random_swarm_node(self, signal="SEGV", delay=None):
4850
if delay is None:
4951
delay = random.random() * 10 + 1
5052

53+
if delay_before_execution > 0:
54+
with When(f"I wait {delay_before_execution}s"):
55+
time.sleep(delay_before_execution)
56+
5157
with interrupt_clickhouse(clickhouse_node, safe=False, signal=signal):
52-
with When(f"I wait {delay:.2}s"):
58+
with When(f"I wait {delay}s"):
5359
time.sleep(delay)
5460

5561

0 commit comments

Comments
 (0)