shangxinli commented on code in PR #875:
URL: https://github.com/apache/iceberg-cpp/pull/875#discussion_r4404194531
##########
src/iceberg/test/arrow_io_test.cc:
##########
@@ -356,6 +373,44 @@ TEST_F(LocalFileIOTest, ReadWriteFile) {
EXPECT_THAT(read_res, HasValue(::testing::Eq("hello world")));
}
+TEST_F(LocalFileIOTest, SizeReleasesTemporaryArrowFile) {
+ auto fs = std::make_shared<TrackingLocalFileSystem>();
+ auto file_io = std::make_shared<arrow::ArrowFileSystemFileIO>(fs);
+ ASSERT_THAT(file_io->WriteFile(temp_filepath_, "hello"), IsOk());
+ ICEBERG_UNWRAP_OR_FAIL(auto input_file,
file_io->NewInputFile(temp_filepath_));
+
+ EXPECT_THAT(input_file->Size(), HasValue(::testing::Eq(5)));
+ ASSERT_EQ(fs->opened_inputs.size(), 1);
+ EXPECT_TRUE(fs->opened_inputs.front().expired());
Review Comment:
this assertion passes because the local shared_ptr goes out of scope at
return, not because of the new explicit Close() call this test is meant to
cover.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]