From f8ad979c7a20a5c9fe5f319f3953c927222652d9 Mon Sep 17 00:00:00 2001 From: overtrue Date: Sat, 22 Aug 2026 08:39:56 +0800 Subject: [PATCH] fix(kms): use .expect() instead of ? in test functions that return () 7 call sites of wait_for_kms_ready() used ? in async test functions that return () instead of Result. Changed to .expect("KMS ready"). --- crates/e2e_test/src/kms/copy_object_self_copy_sse_test.rs | 6 +++--- .../src/kms/copy_object_version_restore_sse_test.rs | 2 +- crates/e2e_test/src/kms/kms_local_test.rs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/e2e_test/src/kms/copy_object_self_copy_sse_test.rs b/crates/e2e_test/src/kms/copy_object_self_copy_sse_test.rs index 1e633679d..85a013ab3 100644 --- a/crates/e2e_test/src/kms/copy_object_self_copy_sse_test.rs +++ b/crates/e2e_test/src/kms/copy_object_self_copy_sse_test.rs @@ -61,7 +61,7 @@ async fn test_metadata_replace_self_copy_of_sse_object_stays_decryptable() { ) .await .expect("failed to start RustFS with local KMS"); - kms_env.wait_for_kms_ready().await?; + kms_env.wait_for_kms_ready().await.expect("KMS ready"); let client = kms_env.base_env.create_s3_client(); // Deliberately an UNVERSIONED bucket: that is the branch where the store layer can service @@ -160,7 +160,7 @@ async fn test_metadata_replace_self_copy_dropping_sse_rewrites_plaintext() { ) .await .expect("failed to start RustFS with local KMS"); - kms_env.wait_for_kms_ready().await?; + kms_env.wait_for_kms_ready().await.expect("KMS ready"); let client = kms_env.base_env.create_s3_client(); // Unversioned, and deliberately WITHOUT a bucket default-encryption rule, so the copy below @@ -256,7 +256,7 @@ async fn test_metadata_replace_self_copy_under_bucket_default_sse_stays_decrypta ) .await .expect("failed to start RustFS with local KMS"); - kms_env.wait_for_kms_ready().await?; + kms_env.wait_for_kms_ready().await.expect("KMS ready"); let client = kms_env.base_env.create_s3_client(); let bucket = "copy-object-self-copy-bucket-default-sse-test"; diff --git a/crates/e2e_test/src/kms/copy_object_version_restore_sse_test.rs b/crates/e2e_test/src/kms/copy_object_version_restore_sse_test.rs index 3edaaa665..c7a572e93 100644 --- a/crates/e2e_test/src/kms/copy_object_version_restore_sse_test.rs +++ b/crates/e2e_test/src/kms/copy_object_version_restore_sse_test.rs @@ -56,7 +56,7 @@ async fn test_self_copy_of_historical_sse_s3_version_is_readable() { ) .await .expect("failed to start RustFS with local KMS"); - kms_env.wait_for_kms_ready().await?; + kms_env.wait_for_kms_ready().await.expect("KMS ready"); let client = kms_env.base_env.create_s3_client(); let bucket = "copy-object-version-restore-sse-test"; diff --git a/crates/e2e_test/src/kms/kms_local_test.rs b/crates/e2e_test/src/kms/kms_local_test.rs index c03e3bbf7..522b28478 100644 --- a/crates/e2e_test/src/kms/kms_local_test.rs +++ b/crates/e2e_test/src/kms/kms_local_test.rs @@ -127,7 +127,7 @@ async fn test_local_kms_key_isolation() { .expect("Failed to start RustFS with Local KMS"); // Wait a moment for RustFS to fully start up and initialize KMS - kms_env.wait_for_kms_ready().await?; + kms_env.wait_for_kms_ready().await.expect("KMS ready"); info!("RustFS started with KMS auto-configuration, default_key_id: {}", default_key_id); @@ -227,7 +227,7 @@ async fn test_local_kms_large_file() { .expect("Failed to start RustFS with Local KMS"); // Wait a moment for RustFS to fully start up and initialize KMS - kms_env.wait_for_kms_ready().await?; + kms_env.wait_for_kms_ready().await.expect("KMS ready"); info!("RustFS started with KMS auto-configuration, default_key_id: {}", default_key_id); @@ -309,7 +309,7 @@ async fn test_local_kms_multipart_upload() { .expect("Failed to start RustFS with Local KMS"); // Wait for KMS initialization - kms_env.wait_for_kms_ready().await?; + kms_env.wait_for_kms_ready().await.expect("KMS ready"); info!("RustFS started with KMS auto-configuration, default_key_id: {}", default_key_id);