Puts create_tmp_accounts_dir_for_tests() behind DCOU (#34022)
This commit is contained in:
parent
b91da2242d
commit
04e4efd8ae
|
@ -19,9 +19,7 @@ use {
|
||||||
regex::Regex,
|
regex::Regex,
|
||||||
solana_accounts_db::{
|
solana_accounts_db::{
|
||||||
account_storage::AccountStorageMap,
|
account_storage::AccountStorageMap,
|
||||||
accounts_db::{
|
accounts_db::{self, AccountStorageEntry, AtomicAppendVecId},
|
||||||
self, create_accounts_run_and_snapshot_dirs, AccountStorageEntry, AtomicAppendVecId,
|
|
||||||
},
|
|
||||||
accounts_file::AccountsFileError,
|
accounts_file::AccountsFileError,
|
||||||
append_vec::AppendVec,
|
append_vec::AppendVec,
|
||||||
hardened_unpack::{self, ParallelSelector, UnpackError},
|
hardened_unpack::{self, ParallelSelector, UnpackError},
|
||||||
|
@ -1999,7 +1997,9 @@ pub fn verify_snapshot_archive(
|
||||||
) {
|
) {
|
||||||
let temp_dir = tempfile::TempDir::new().unwrap();
|
let temp_dir = tempfile::TempDir::new().unwrap();
|
||||||
let unpack_dir = temp_dir.path();
|
let unpack_dir = temp_dir.path();
|
||||||
let unpack_account_dir = create_accounts_run_and_snapshot_dirs(unpack_dir).unwrap().0;
|
let unpack_account_dir = accounts_db::create_accounts_run_and_snapshot_dirs(unpack_dir)
|
||||||
|
.unwrap()
|
||||||
|
.0;
|
||||||
untar_snapshot_in(
|
untar_snapshot_in(
|
||||||
snapshot_archive,
|
snapshot_archive,
|
||||||
unpack_dir,
|
unpack_dir,
|
||||||
|
@ -2170,9 +2170,16 @@ pub fn should_take_incremental_snapshot(
|
||||||
&& last_full_snapshot_slot.is_some()
|
&& last_full_snapshot_slot.is_some()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Creates an "accounts path" directory for tests
|
||||||
|
///
|
||||||
|
/// This temporary directory will contain the "run" and "snapshot"
|
||||||
|
/// sub-directories required by a validator.
|
||||||
|
#[cfg(feature = "dev-context-only-utils")]
|
||||||
pub fn create_tmp_accounts_dir_for_tests() -> (TempDir, PathBuf) {
|
pub fn create_tmp_accounts_dir_for_tests() -> (TempDir, PathBuf) {
|
||||||
let tmp_dir = tempfile::TempDir::new().unwrap();
|
let tmp_dir = tempfile::TempDir::new().unwrap();
|
||||||
let account_dir = create_accounts_run_and_snapshot_dirs(&tmp_dir).unwrap().0;
|
let account_dir = accounts_db::create_accounts_run_and_snapshot_dirs(&tmp_dir)
|
||||||
|
.unwrap()
|
||||||
|
.0;
|
||||||
(tmp_dir, account_dir)
|
(tmp_dir, account_dir)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue