From 27462eaaf03f0c8cd83f47fde7b30802d02ead85 Mon Sep 17 00:00:00 2001 From: "Lei, HUANG" <6406592+v0y4g3r@users.noreply.github.com> Date: Mon, 3 Aug 2026 10:36:56 +0800 Subject: [PATCH] test(object-store): fix racy SecureFs abort test (#8720) test_writer_abort_is_unsupported_without_atomic_write asserted the file content immediately after abort() returned Unsupported. SecureFsWriter writes through tokio::fs::File, whose write_all() only enqueues a blocking write task (tokio's poll_write returns Ready before the write completes), so the data may not be visible yet when the test reads the file. Drop the race-prone content assertion and only verify the Unsupported contract. Signed-off-by: Lei, HUANG --- src/object-store/src/secure_fs.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/object-store/src/secure_fs.rs b/src/object-store/src/secure_fs.rs index 448949ea5e..cb58f6b2ad 100644 --- a/src/object-store/src/secure_fs.rs +++ b/src/object-store/src/secure_fs.rs @@ -662,7 +662,6 @@ mod tests { #[tokio::test] async fn test_writer_abort_is_unsupported_without_atomic_write() { let temp_dir = create_temp_dir("secure_fs_writer_abort"); - std::fs::write(temp_dir.path().join("partial"), b"original").unwrap(); let operator = SecureFsRoot::open(temp_dir.path()) .unwrap() .build_operator(); @@ -672,11 +671,5 @@ mod tests { let error = writer.abort().await.unwrap_err(); assert_eq!(ErrorKind::Unsupported, error.kind()); - assert_eq!( - b"partial", - std::fs::read(temp_dir.path().join("partial")) - .unwrap() - .as_slice() - ); } }