llama90 commented on code in PR #43286:
URL: https://github.com/apache/arrow/pull/43286#discussion_r1679664754


##########
cpp/src/arrow/filesystem/s3fs_test.cc:
##########
@@ -1086,6 +1116,74 @@ TEST_F(TestS3FS, DeleteDirContentsAsync) {
   AssertFileInfo(infos[3], "bucket/somefile", FileType::File);
 }
 
+TEST_F(TestS3FS, DeleteFileWithMarker) {
+  FileSelector select;
+  select.base_dir = "bucket/somedir/subdir";
+  select.recursive = false;
+  std::vector<FileInfo> infos;
+
+  // Expected files before deletion
+  std::vector<std::string> expected_before = {
+      "somedir/subdir/subfile",
+  };
+
+  // Verify the list of objects before deletion
+  AssertListObjects(client_.get(), "bucket", "somedir/subdir", 
expected_before);
+
+  ASSERT_OK_AND_ASSIGN(infos, fs_->GetFileInfo(select));
+  ASSERT_EQ(infos.size(), 1);
+
+  ASSERT_OK(fs_->DeleteFile("bucket/somedir/subdir/subfile"));
+
+  // Expected files after deletion
+  std::vector<std::string> expected_after = {
+      "somedir/subdir/",
+  };
+
+  // Verify the list of objects after deletion
+  AssertListObjects(client_.get(), "bucket", "somedir/subdir", expected_after);

Review Comment:
   Initially, I tried to write the test using only the `GetFileInfo` function, 
but I added the `ListObjectsV2Request` API because I thought it would more 
intuitively reproduce the issue.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to