diff --git a/tests/consensus_tests/test_dirty_shard_crash_loop.py b/tests/consensus_tests/test_dirty_shard_crash_loop.py index 522462408c..0f4ccb52a1 100644 --- a/tests/consensus_tests/test_dirty_shard_crash_loop.py +++ b/tests/consensus_tests/test_dirty_shard_crash_loop.py @@ -85,16 +85,20 @@ def test_dirty_shard_survives_update_collection(tmp_path: pathlib.Path): assert r.status_code == 200, f"UpdateCollection failed: {r.text}" # Restart target briefly (no dirty flag) so it syncs the UpdateCollection entry + sync_log = f"peer_sync_{target_idx}.log" sync_uri = start_peer( peer_dirs[target_idx], - f"peer_sync_{target_idx}.log", + sync_log, bootstrap_uri, port=restart_port, ) - # Under parallel pytest-xdist load the leader can take longer than the - # default 30s budget to replicate the UpdateCollection entry and let the - # rejoining peer report ready. Allow more time to avoid CPU-contention flakes. - wait_for_peer_online(sync_uri, wait_for_timeout=60) + online, exit_code = wait_for_peer_online_or_crash(sync_uri, processes[-1]) + if not online: + log_content = read_log(sync_log) + pytest.fail( + f"Sync restart failed to come online (exit code {exit_code}).\n" + f"Log tail:\n{log_content[-1000:]}" + ) # Kill again — the UpdateCollection entry is now committed in its WAL p = processes.pop() @@ -122,7 +126,7 @@ def test_dirty_shard_survives_update_collection(tmp_path: pathlib.Path): port=restart_port, ) - online, exit_code = wait_for_peer_online_or_crash(new_uri, processes[-1], timeout=60) + online, exit_code = wait_for_peer_online_or_crash(new_uri, processes[-1], timeout=30) if not online: log_content = read_log(restart_log)