test: rest_api: fix test_repair_task_progress

test_repair_task_progress checks the progress of children of root
repair task. However, nothing ensures that the children are
already created.

Wait until at least one child of a root repair task is created.

Fixes: #24556.

Closes scylladb/scylladb#24560

(cherry picked from commit 0deb9209a0)

Closes scylladb/scylladb#24655
This commit is contained in:
Aleksandra Martyniuk
2025-06-18 12:35:35 +02:00
committed by Pavel Emelyanov
parent 2c89800e76
commit 7fd4d77fdd

View File

@@ -96,10 +96,11 @@ def test_repair_task_progress(cql, this_dc, rest_api):
sequence_number = resp.json()
# Get all repairs.
statuses = [get_task_status(rest_api, task["task_id"]) for task in list_tasks(rest_api, "repair") if task["sequence_number"] == sequence_number]
statuses = []
while not statuses or "children_ids" not in statuses[0]:
statuses = [get_task_status(rest_api, task["task_id"]) for task in list_tasks(rest_api, "repair") if task["sequence_number"] == sequence_number]
assert len(statuses) == 1, "Wrong number of internal repair tasks"
status = statuses[0]
assert "children_ids" in status, "No child tasks created"
for child_ident in status["children_ids"]:
# Check if task state is correct.