diff --git a/test/storage/node_insertion_deletion_test.cpp b/test/storage/node_insertion_deletion_test.cpp index 1b0f9d72ed..41dc5d6db8 100644 --- a/test/storage/node_insertion_deletion_test.cpp +++ b/test/storage/node_insertion_deletion_test.cpp @@ -1,5 +1,7 @@ +#include + #include "common/constants.h" -#include "common/file_utils.h" +#include "common/file_system/local_file_system.h" #include "graph_test/graph_test.h" using namespace kuzu::common; @@ -111,6 +113,7 @@ TEST_F(NodeInsertionDeletionTests, InsertManyNodesTest) { TEST_F(NodeInsertionDeletionTests, TruncatedWalTest) { auto preparedStatement = conn->prepare("CREATE (:person {ID:$id});"); + auto fs = LocalFileSystem(); // Note: this test will fail if the transaction is small enough to fit the wal headers in a // single page, since we currently may fail to recover if the headers are intact but shadow // pages are missing. Pages are flushed before writing the commit record to make sure that @@ -122,14 +125,14 @@ TEST_F(NodeInsertionDeletionTests, TruncatedWalTest) { } conn->query("COMMIT_SKIP_CHECKPOINT"); auto databasePath = this->databasePath; - auto walPath = FileUtils::joinPath(databasePath, StorageConstants::WAL_FILE_SUFFIX); + auto walPath = fs.joinPath(databasePath, StorageConstants::WAL_FILE_SUFFIX); // Close database database.reset(); { - auto walFileInfo = FileUtils::openFile(walPath, O_RDWR); + auto walFileInfo = fs.openFile(walPath, O_RDWR); ASSERT_GT(walFileInfo->getFileSize(), BufferPoolConstants::PAGE_4KB_SIZE) << "Test needs a wal file with more than one page"; - FileUtils::truncateFileToSize(walFileInfo.get(), BufferPoolConstants::PAGE_4KB_SIZE); + walFileInfo->truncate(BufferPoolConstants::PAGE_4KB_SIZE); } // Re-open database database = std::make_unique(databasePath);