From 4d289222c9c2ff515ad69660709eb087fcbf59b6 Mon Sep 17 00:00:00 2001 From: Brooks Date: Wed, 15 Feb 2023 15:54:48 -0500 Subject: [PATCH] Fixes race in local cluster incremental snapshot test (#30340) --- local-cluster/tests/local_cluster.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/local-cluster/tests/local_cluster.rs b/local-cluster/tests/local_cluster.rs index 45d8ae6fa..4b5178e61 100644 --- a/local-cluster/tests/local_cluster.rs +++ b/local-cluster/tests/local_cluster.rs @@ -1054,6 +1054,11 @@ fn test_incremental_snapshot_download_with_crossing_full_snapshot_interval_at_st }; info!("leader full snapshot archive for comparison: {leader_full_snapshot_archive_for_comparison:#?}"); + // Stop the validator before we reset its snapshots + info!("Stopping the validator..."); + let validator_info = cluster.exit_node(&validator_identity.pubkey()); + info!("Stopping the validator... DONE"); + info!("Delete all the snapshots on the validator and restore the originals from the backup..."); delete_files_with_remote( validator_snapshot_test_config @@ -1093,15 +1098,10 @@ fn test_incremental_snapshot_download_with_crossing_full_snapshot_interval_at_st info!( "Restarting the validator with full snapshot {validator_full_snapshot_slot_at_startup}..." ); - - // Stop the test validator - let validator_info = cluster.exit_node(&validator_identity.pubkey()); - // To restart, it is not enough to remove the old bank snapshot directories under snapshot/. // The old hardlinks under /snapshot/ should also be removed. // The purge call covers all of them. snapshot_utils::purge_old_bank_snapshots(validator_snapshot_test_config.bank_snapshots_dir, 0); - cluster.restart_node( &validator_identity.pubkey(), validator_info,