Skip to content

Commit f30c11b

Browse files
committed
Fix localInfile UT
1 parent 4a0db70 commit f30c11b

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

test/unit/classes/connection.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3239,19 +3239,25 @@ void connection::localInfile()
32393239
temp_dir = "/tmp/";
32403240
#endif
32413241

3242-
dir = temp_dir + "test/";
3242+
#ifndef _WIN32
3243+
std::string pid = std::to_string(getpid());
3244+
#else
3245+
std::string pid = std::to_string(GetCurrentProcessId());
3246+
#endif
3247+
3248+
dir = temp_dir + std::string("test")+pid+"/";
32433249
file_path = dir + "infile.txt";
32443250

32453251
dataDir dir_test(dir);
3246-
dataDir dir_link(temp_dir + "test_link/");
3247-
dataDir dir_subdir_link(temp_dir + "test_subdir_link/");
3252+
dataDir dir_link(temp_dir + "test_link" + pid +"/");
3253+
dataDir dir_subdir_link(temp_dir + "test_subdir_link" + pid + "/");
32483254

32493255
dataFile infile(dir, "infile.txt");
32503256

32513257
#ifndef _WIN32
3252-
dataFile infile_wo("/tmp/test/", "infile_wo.txt", true);
3253-
dataSymlink sl(file_path, temp_dir + "test_link/link_infile.txt");
3254-
dataSymlink sld(dir, temp_dir + "test_subdir_link/subdir");
3258+
dataFile infile_wo(dir, "infile_wo.txt", true);
3259+
dataSymlink sl(file_path, temp_dir + "test_link"+ pid + "/link_infile.txt");
3260+
dataSymlink sld(dir, temp_dir + "test_subdir_link"+ pid + "/subdir");
32553261
std::string sld_file = sld.path();
32563262
sld_file.append("/infile.txt");
32573263
#endif

0 commit comments

Comments
 (0)