@@ -1017,7 +1017,7 @@ TEST_P(FileSystemTest, TestMkdir2) {
10171017 }
10181018}
10191019
1020- // test for create multi dir such as "partition1/bucket1" and "partition1/bucket2"
1020+ // test for create multi dir such as "/table/ partition1/bucket1" and "/table/ partition1/bucket2"
10211021TEST_P (FileSystemTest, TestMkdirMultiThread) {
10221022 uint32_t runs_count = 10 ;
10231023 uint32_t thread_count = 10 ;
@@ -1042,7 +1042,7 @@ TEST_P(FileSystemTest, TestMkdirMultiThread) {
10421042 }
10431043}
10441044
1045- // test for create multi dir such as "partition1" and "partition1"
1045+ // test for create multi dir such as "/table/ partition1" and "/table/ partition1"
10461046TEST_P (FileSystemTest, TestMkdirMultiThread2) {
10471047 uint32_t runs_count = 10 ;
10481048 uint32_t thread_count = 10 ;
@@ -1055,8 +1055,28 @@ TEST_P(FileSystemTest, TestMkdirMultiThread2) {
10551055 for (uint32_t thread_idx = 0 ; thread_idx < thread_count; thread_idx++) {
10561056 futures.push_back (Via (executor.get (), [this , &uuid]() -> void {
10571057 std::string dir_path = PathUtil::JoinPath (test_root_, uuid);
1058- // ASSERT_OK_AND_ASSIGN(bool is_exist, fs_->Exists(dir_path));
1059- // ASSERT_FALSE(is_exist);
1058+ ASSERT_OK (fs_->Mkdirs (dir_path));
1059+ ASSERT_OK_AND_ASSIGN (bool is_exist, fs_->Exists (dir_path));
1060+ ASSERT_TRUE (is_exist);
1061+ }));
1062+ }
1063+ Wait (futures);
1064+ }
1065+ }
1066+
1067+ // test for create multi dir such as "partition1" and "partition1" (relative path)
1068+ TEST_P (FileSystemTest, TestMkdirMultiThread3) {
1069+ uint32_t runs_count = 10 ;
1070+ uint32_t thread_count = 10 ;
1071+ auto executor = CreateDefaultExecutor (thread_count);
1072+
1073+ for (uint32_t i = 0 ; i < runs_count; i++) {
1074+ std::string uuid;
1075+ ASSERT_TRUE (UUID::Generate (&uuid));
1076+ std::vector<std::future<void >> futures;
1077+ for (uint32_t thread_idx = 0 ; thread_idx < thread_count; thread_idx++) {
1078+ futures.push_back (Via (executor.get (), [this , &uuid]() -> void {
1079+ std::string dir_path = uuid;
10601080 ASSERT_OK (fs_->Mkdirs (dir_path));
10611081 ASSERT_OK_AND_ASSIGN (bool is_exist, fs_->Exists (dir_path));
10621082 ASSERT_TRUE (is_exist);
0 commit comments