test(ci): stabilize main fixture paths (#6523)

This commit is contained in:
Zhengchao An
2026-08-24 19:34:02 +08:00
committed by GitHub
parent e2193cc42c
commit a1ebe9a3b3
5 changed files with 13 additions and 8 deletions
@@ -94,7 +94,6 @@ async fn minio_permanent_identities_survive_migration_and_repeated_iam_loads() {
let temp_dir = tempfile::TempDir::with_prefix("rustfs_minio_iam_migration_").expect("temp directory must be created");
let env = rustfs_test_utils::TestECStoreEnv::builder()
.base_dir(temp_dir.path())
.init_bucket_metadata(false)
.build()
.await;
env.make_bucket(LEGACY_META_BUCKET, false).await;
+1 -2
View File
@@ -190,8 +190,7 @@ impl TestECStoreEnvBuilder {
}
/// Whether to run `init_bucket_metadata_sys` after the store comes up
/// (default `true`, as the heal bootstraps did). The IAM bootstrap test
/// opts out to preserve its historical semantics.
/// (default `true`, as the heal bootstraps did).
pub fn init_bucket_metadata(mut self, yes: bool) -> Self {
self.init_bucket_metadata = yes;
self
+8 -3
View File
@@ -193,8 +193,13 @@ async fn heal_object_marks_missing_shard_disk_dirty_for_capacity_manager() {
let _ = manager.get_dirty_disks().await;
let object_root = disk_paths[0].join(&bucket_name).join("test").join("heal.bin");
let missing_part = find_part_file(&object_root, "part.1").expect("part file on first disk");
let (missing_disk, missing_part) = disk_paths
.iter()
.find_map(|disk_path| {
let object_root = disk_path.join(&bucket_name).join("test").join("heal.bin");
find_part_file(&object_root, "part.1").map(|part| (disk_path, part))
})
.expect("part file on an erasure disk");
fs::remove_file(&missing_part).await.expect("remove shard to force heal");
let heal_opts = HealOpts {
@@ -219,7 +224,7 @@ async fn heal_object_marks_missing_shard_disk_dirty_for_capacity_manager() {
.into_iter()
.map(|disk| stdfs::canonicalize(&disk.drive_path).unwrap().to_string_lossy().into_owned())
.collect();
let expected_missing_disk = stdfs::canonicalize(&disk_paths[0]).unwrap().to_string_lossy().into_owned();
let expected_missing_disk = stdfs::canonicalize(missing_disk).unwrap().to_string_lossy().into_owned();
assert!(
error.is_none() || actual_paths.contains(&expected_missing_disk),
+2 -1
View File
@@ -434,7 +434,8 @@ mod tests {
};
fn secure_tempdir() -> tempfile::TempDir {
let home = std::path::PathBuf::from(std::env::var_os("HOME").expect("test requires a protected home directory"));
let home = std::fs::canonicalize(std::env::var_os("HOME").expect("test requires a protected home directory"))
.expect("test home directory must resolve without symlink components");
tempfile::Builder::new()
.prefix(".connect-registration-bootstrap-")
.tempdir_in(home)
@@ -278,7 +278,8 @@ fn prepare_inputs(temp: &tempfile::TempDir, root_pem: &str) -> (std::path::PathB
}
fn secure_tempdir() -> tempfile::TempDir {
let home = std::path::PathBuf::from(std::env::var_os("HOME").expect("test requires a protected home directory"));
let home = std::fs::canonicalize(std::env::var_os("HOME").expect("test requires a protected home directory"))
.expect("test home directory must resolve without symlink components");
tempfile::Builder::new()
.prefix(".connect-registration-")
.tempdir_in(home)