Fix unit test case of thread pool (#26501)

Signed-off-by: luzhang <luzhang@zilliz.com>
Co-authored-by: luzhang <luzhang@zilliz.com>
pull/26523/head
zhagnlu 2023-08-21 21:50:22 +08:00 committed by GitHub
parent a4b3441947
commit 0cb3f88e73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -129,8 +129,6 @@ TEST_F(DiskAnnFileManagerTest, TestThreadPoolBase) {
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();
EXPECT_GT(thread_num_2, thread_num_1);
for (int i = 0; i < 10; ++i) {
std::cout << futs[i].get() << std::endl;
@ -139,8 +137,8 @@ TEST_F(DiskAnnFileManagerTest, TestThreadPoolBase) {
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();
EXPECT_LT(thread_num_3, thread_num_2);
auto thread_num_2 = thread_pool->GetThreadNum();
EXPECT_EQ(thread_num_2, thread_num_1);
}
TEST_F(DiskAnnFileManagerTest, TestThreadPool) {