From 1d861ad55847065957a96bf224bdf3f0f5f37139 Mon Sep 17 00:00:00 2001 From: Brooks Date: Fri, 5 May 2023 12:52:36 -0400 Subject: [PATCH] Removes solana_logger from snapshot_utils unit tests (#31510) --- runtime/src/snapshot_utils.rs | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/runtime/src/snapshot_utils.rs b/runtime/src/snapshot_utils.rs index e3ae6eaa54..c02055ffec 100644 --- a/runtime/src/snapshot_utils.rs +++ b/runtime/src/snapshot_utils.rs @@ -3570,7 +3570,6 @@ mod tests { #[test] fn test_parse_incremental_snapshot_archive_filename() { - solana_logger::setup(); assert_eq!( parse_incremental_snapshot_archive_filename(&format!( "incremental-snapshot-42-123-{}.tar.bz2", @@ -3656,7 +3655,6 @@ mod tests { #[test] fn test_check_are_snapshots_compatible() { - solana_logger::setup(); let slot1: Slot = 1234; let slot2: Slot = 5678; let slot3: Slot = 999_999; @@ -3727,7 +3725,6 @@ mod tests { #[test] fn test_get_bank_snapshots() { - solana_logger::setup(); let temp_snapshots_dir = tempfile::TempDir::new().unwrap(); let min_slot = 10; let max_slot = 20; @@ -3739,7 +3736,6 @@ mod tests { #[test] fn test_get_highest_bank_snapshot_post() { - solana_logger::setup(); let temp_snapshots_dir = tempfile::TempDir::new().unwrap(); let min_slot = 99; let max_slot = 123; @@ -3803,7 +3799,6 @@ mod tests { #[test] fn test_get_full_snapshot_archives() { - solana_logger::setup(); let full_snapshot_archives_dir = tempfile::TempDir::new().unwrap(); let incremental_snapshot_archives_dir = tempfile::TempDir::new().unwrap(); let min_slot = 123; @@ -3823,7 +3818,6 @@ mod tests { #[test] fn test_get_full_snapshot_archives_remote() { - solana_logger::setup(); let full_snapshot_archives_dir = tempfile::TempDir::new().unwrap(); let incremental_snapshot_archives_dir = tempfile::TempDir::new().unwrap(); let min_slot = 123; @@ -3848,7 +3842,6 @@ mod tests { #[test] fn test_get_incremental_snapshot_archives() { - solana_logger::setup(); let full_snapshot_archives_dir = tempfile::TempDir::new().unwrap(); let incremental_snapshot_archives_dir = tempfile::TempDir::new().unwrap(); let min_full_snapshot_slot = 12; @@ -3875,7 +3868,6 @@ mod tests { #[test] fn test_get_incremental_snapshot_archives_remote() { - solana_logger::setup(); let full_snapshot_archives_dir = tempfile::TempDir::new().unwrap(); let incremental_snapshot_archives_dir = tempfile::TempDir::new().unwrap(); let min_full_snapshot_slot = 12; @@ -3909,7 +3901,6 @@ mod tests { #[test] fn test_get_highest_full_snapshot_archive_slot() { - solana_logger::setup(); let full_snapshot_archives_dir = tempfile::TempDir::new().unwrap(); let incremental_snapshot_archives_dir = tempfile::TempDir::new().unwrap(); let min_slot = 123; @@ -3931,7 +3922,6 @@ mod tests { #[test] fn test_get_highest_incremental_snapshot_slot() { - solana_logger::setup(); let full_snapshot_archives_dir = tempfile::TempDir::new().unwrap(); let incremental_snapshot_archives_dir = tempfile::TempDir::new().unwrap(); let min_full_snapshot_slot = 12; @@ -4092,7 +4082,6 @@ mod tests { #[test] fn test_purge_old_incremental_snapshot_archives() { - solana_logger::setup(); let full_snapshot_archives_dir = tempfile::TempDir::new().unwrap(); let incremental_snapshot_archives_dir = tempfile::TempDir::new().unwrap(); let starting_slot = 100_000; @@ -4259,7 +4248,6 @@ mod tests { /// bank possible, so the contents of the snapshot archive will be quite minimal. #[test] fn test_roundtrip_bank_to_and_from_full_snapshot_simple() { - solana_logger::setup(); let genesis_config = GenesisConfig::default(); let original_bank = Bank::new_for_tests(&genesis_config); @@ -4314,7 +4302,6 @@ mod tests { /// multiple transfers. So this full snapshot should contain more data. #[test] fn test_roundtrip_bank_to_and_from_snapshot_complex() { - solana_logger::setup(); let collector = Pubkey::new_unique(); let key1 = Keypair::new(); let key2 = Keypair::new(); @@ -4432,7 +4419,6 @@ mod tests { /// of the accounts are not modified often, and are captured by the full snapshot. #[test] fn test_roundtrip_bank_to_and_from_incremental_snapshot() { - solana_logger::setup(); let collector = Pubkey::new_unique(); let key1 = Keypair::new(); let key2 = Keypair::new(); @@ -4556,7 +4542,6 @@ mod tests { /// Test rebuilding bank from the latest snapshot archives #[test] fn test_bank_from_latest_snapshot_archives() { - solana_logger::setup(); let collector = Pubkey::new_unique(); let key1 = Keypair::new(); let key2 = Keypair::new(); @@ -4699,8 +4684,6 @@ mod tests { /// no longer correct! #[test] fn test_incremental_snapshots_handle_zero_lamport_accounts() { - solana_logger::setup(); - let collector = Pubkey::new_unique(); let key1 = Keypair::new(); let key2 = Keypair::new(); @@ -4890,7 +4873,6 @@ mod tests { #[test] fn test_bank_fields_from_snapshot() { - solana_logger::setup(); let collector = Pubkey::new_unique(); let key1 = Keypair::new(); @@ -5103,7 +5085,6 @@ mod tests { #[test] fn test_bank_snapshot_dir_accounts_hardlinks() { - solana_logger::setup(); let genesis_config = GenesisConfig::default(); let bank = Bank::new_for_tests(&genesis_config); @@ -5149,8 +5130,6 @@ mod tests { #[test] fn test_get_snapshot_accounts_hardlink_dir() { - solana_logger::setup(); - let slot: Slot = 1; let mut account_paths_set: HashSet = HashSet::new(); @@ -5190,8 +5169,6 @@ mod tests { #[test] fn test_get_highest_bank_snapshot() { - solana_logger::setup(); - let genesis_config = GenesisConfig::default(); let bank_snapshots_dir = tempfile::TempDir::new().unwrap(); let _bank = create_snapshot_dirs_for_tests(&genesis_config, &bank_snapshots_dir, 4, 0); @@ -5222,8 +5199,6 @@ mod tests { #[test] pub fn test_create_all_accounts_run_and_snapshot_dirs() { - solana_logger::setup(); - let (_tmp_dirs, account_paths): (Vec, Vec) = (0..4) .map(|_| { let tmp_dir = tempfile::TempDir::new().unwrap(); @@ -5270,8 +5245,6 @@ mod tests { #[test] fn test_clean_orphaned_account_snapshot_dirs() { - solana_logger::setup(); - let genesis_config = GenesisConfig::default(); let bank_snapshots_dir = tempfile::TempDir::new().unwrap(); let _bank = create_snapshot_dirs_for_tests(&genesis_config, &bank_snapshots_dir, 2, 0); @@ -5482,8 +5455,6 @@ mod tests { #[test] fn test_bank_from_snapshot_dir() { - solana_logger::setup(); - let genesis_config = GenesisConfig::default(); let bank_snapshots_dir = tempfile::TempDir::new().unwrap(); let bank = create_snapshot_dirs_for_tests(&genesis_config, &bank_snapshots_dir, 3, 0); @@ -5527,8 +5498,6 @@ mod tests { #[test] fn test_bank_from_latest_snapshot_dir() { - solana_logger::setup(); - let genesis_config = GenesisConfig::default(); let bank_snapshots_dir = tempfile::TempDir::new().unwrap(); let bank = create_snapshot_dirs_for_tests(&genesis_config, &bank_snapshots_dir, 3, 3); @@ -5560,8 +5529,6 @@ mod tests { #[test] fn test_purge_old_bank_snapshots() { - solana_logger::setup(); - let genesis_config = GenesisConfig::default(); let bank_snapshots_dir = tempfile::TempDir::new().unwrap(); let _bank = create_snapshot_dirs_for_tests(&genesis_config, &bank_snapshots_dir, 10, 5);