mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 03:48:37 +08:00
fix unstable test case for thread pool (#26465)
Signed-off-by: luzhang <luzhang@zilliz.com> Co-authored-by: luzhang <luzhang@zilliz.com>
This commit is contained in:
parent
c073aa0dc3
commit
79ca04b995
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user