File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -241,14 +241,20 @@ TEST(CatalogCoverageTests, SaveAndLoad) {
241241 std::vector<ColumnInfo> cols = {{" id" , common::ValueType::TYPE_INT64, 0 }};
242242 catalog->create_table (" persisted_table" , cols);
243243
244- // Use mkstemp to create a unique temp file atomically
245- std::string temp_template = " /tmp/test_catalog_XXXXXX .bin" ;
244+ // Use a unique path in test_data directory (mkstemp may fail on some CI runners)
245+ std::string temp_template = " ./test_data/save_load_test_XXXXXX .bin" ;
246246 std::vector<char > temp_path_vec (temp_template.begin (), temp_template.end ());
247- temp_path_vec.push_back (' \0 ' ); // null-terminate for mkstemp
247+ temp_path_vec.push_back (' \0 ' );
248248 int fd = mkstemp (temp_path_vec.data ());
249- ASSERT_NE (fd, -1 );
250- std::filesystem::path temp_path (temp_path_vec.data ());
251- close (fd); // Close the file descriptor, we only need the path
249+ std::string temp_path;
250+ if (fd != -1 ) {
251+ temp_path = std::string (temp_path_vec.data ());
252+ close (fd);
253+ } else {
254+ // Fallback: use a fixed path if mkstemp fails
255+ temp_path = std::string (" ./test_data/save_load_test_fallback.bin" );
256+ std::filesystem::remove (temp_path);
257+ }
252258
253259 // Save catalog - should succeed
254260 ASSERT_TRUE (catalog->save (temp_path.string ()));
You can’t perform that action at this time.
0 commit comments