diff --git a/internal/core/unittest/test_disk_file_manager_test.cpp b/internal/core/unittest/test_disk_file_manager_test.cpp index 146a34f775..1a2ba4b80e 100644 --- a/internal/core/unittest/test_disk_file_manager_test.cpp +++ b/internal/core/unittest/test_disk_file_manager_test.cpp @@ -126,6 +126,7 @@ TEST_F(DiskAnnFileManagerTest, TestThreadPoolBase) { for (int i = 0; i < 10; ++i) { futs.push_back(thread_pool->Submit(compute, i)); } + std::this_thread::sleep_for(std::chrono::milliseconds(300)); std::cout << "current thread num" << thread_pool->GetThreadNum() << std::endl; auto thread_num_2 = thread_pool->GetThreadNum(); @@ -135,7 +136,7 @@ TEST_F(DiskAnnFileManagerTest, TestThreadPoolBase) { std::cout << futs[i].get() << std::endl; } - sleep(5); + std::this_thread::sleep_for(std::chrono::milliseconds(5000)); std::cout << "current thread num" << thread_pool->GetThreadNum() << std::endl; auto thread_num_3 = thread_pool->GetThreadNum(); @@ -183,4 +184,4 @@ TEST_F(DiskAnnFileManagerTest, TestThreadPoolException) { } catch (std::exception& e) { EXPECT_EQ(std::string(e.what()), "run time error"); } -} \ No newline at end of file +}