test/mv/test_mv_staging: wait for cql after restart

Wait for cql on all hosts after restarting a server in the test.

The problem that was observed is that the test restarts servers[1] and
doesn't wait for the cql to be ready on it. On test teardown it drops
the keyspace, trying to execute it on the host that is not ready, and
fails.

Fixes SCYLLADB-1632

Closes scylladb/scylladb#29562

(cherry picked from commit 3468e8de8b)

Closes scylladb/scylladb#29624

Closes scylladb/scylladb#29642
This commit is contained in:
Michael Litvak
2026-04-20 09:39:30 +02:00
committed by Botond Dénes
parent 10065d13e4
commit ef3d4e7e47

View File

@@ -78,6 +78,7 @@ async def test_staging_backlog_processed_after_restart(manager: ManagerClient):
# Restart node0
await manager.server_stop_gracefully(servers[0].server_id)
await manager.server_start(servers[0].server_id)
await wait_for_cql_and_get_hosts(cql, servers, time.time() + 60)
# Assert that node0 has no data for base table and MV
hosts = await wait_for_cql_and_get_hosts(cql, [servers[0]], time.time() + 60)
@@ -85,6 +86,7 @@ async def test_staging_backlog_processed_after_restart(manager: ManagerClient):
await assert_row_count_on_host(cql, hosts[0], ks, "tab", 0)
await assert_row_count_on_host(cql, hosts[0], ks, "mv", 0)
await manager.server_start(servers[1].server_id)
await wait_for_cql_and_get_hosts(cql, servers, time.time() + 60)
# Repair the base table
s0_log = await manager.server_open_log(servers[0].server_id)
@@ -99,11 +101,13 @@ async def test_staging_backlog_processed_after_restart(manager: ManagerClient):
await assert_row_count_on_host(cql, hosts[0], ks, "tab", 1000)
await assert_row_count_on_host(cql, hosts[0], ks, "mv", 0)
await manager.server_start(servers[1].server_id)
await wait_for_cql_and_get_hosts(cql, servers, time.time() + 60)
# Restart node0 with staging backlog
s0_mark = await s0_log.mark()
await manager.server_stop_gracefully(servers[0].server_id)
await manager.server_start(servers[0].server_id)
await wait_for_cql_and_get_hosts(cql, servers, time.time() + 60)
await s0_log.wait_for(f"Processed {ks}.tab", from_mark=s0_mark, timeout=60)
hosts = await wait_for_cql_and_get_hosts(cql, [servers[0]], time.time() + 60)