This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 19f5e06a4e1 GH-55356: [C++] Compare mtime at second precision in
`GetFileInfoSelector` test (#55433)
19f5e06a4e1 is described below
commit 19f5e06a4e1899d7cc62b0040fcb8f3f0dca0623
Author: tadeja <[email protected]>
AuthorDate: Sun Nov 8 02:04:15 2026 +0100
GH-55356: [C++] Compare mtime at second precision in `GetFileInfoSelector`
test (#55433)
### Rationale for this change
#55356 - `TestS3FSGeneric.GetFileInfoSelector` fails with AWS SDK 1.11.900
and newer.
See https://github.com/aws/aws-sdk-cpp/pull/3934
`ListObjectsV2` results keep milliseconds while `HeadObject`'s
`Last-Modified` header only has seconds.
### What changes are included in this PR?
Floor the listing `mtime` from milliseconds to seconds in
`GetFileInfoSelector` test when the single file `mtime` has only seconds.
### Are these changes tested?
Locally on macOS arm64 with AWS SDK 1.11.900 and MinIO.
### Are there any user-facing changes?
No.
### Was AI used for this PR?
**PR code and description written by:**
- [X] Human
- [X] AI
**Reviewed before submission by:**
- [X] Human
- [ ] AI
- [ ] Not reviewed
* GitHub Issue: #55356
Lead-authored-by: Tadeja Kadunc <[email protected]>
Co-authored-by: tadeja <[email protected]>
Co-authored-by: Rok Mihevc <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
cpp/src/arrow/filesystem/test_util.cc | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/cpp/src/arrow/filesystem/test_util.cc
b/cpp/src/arrow/filesystem/test_util.cc
index da73a8ec16b..1b96e485fdf 100644
--- a/cpp/src/arrow/filesystem/test_util.cc
+++ b/cpp/src/arrow/filesystem/test_util.cc
@@ -811,6 +811,11 @@ void
GenericFileSystemTest::TestGetFileInfoSelector(FileSystem* fs) {
ASSERT_OK_AND_ASSIGN(info, fs->GetFileInfo("AB"));
AssertFileInfo(info, "AB", FileType::Directory, first_dir_time);
ASSERT_OK_AND_ASSIGN(info, fs->GetFileInfo("AB/CD/ghi"));
+ // aws-sdk-cpp >= 1.11.900 keeps ms in S3 listings, but HeadObject only has
seconds
+ if (info.mtime() == std::chrono::floor<std::chrono::seconds>(info.mtime()) &&
+ first_file_time ==
std::chrono::floor<std::chrono::milliseconds>(first_file_time)) {
+ first_file_time =
std::chrono::floor<std::chrono::seconds>(first_file_time);
+ }
AssertFileInfo(info, "AB/CD/ghi", FileType::File, first_file_time, 15);
// Doesn't exist