From 3d05ddf505ba88f82aafe5d741068368441c040e Mon Sep 17 00:00:00 2001 From: yah01 Date: Wed, 13 Sep 2023 15:41:18 +0800 Subject: [PATCH] Reduce cpp test time (#27043) Signed-off-by: yah01 --- internal/core/unittest/test_indexing.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/internal/core/unittest/test_indexing.cpp b/internal/core/unittest/test_indexing.cpp index 1c6fbdc5c1..1186e9b259 100644 --- a/internal/core/unittest/test_indexing.cpp +++ b/internal/core/unittest/test_indexing.cpp @@ -294,8 +294,14 @@ class IndexTest : public ::testing::TestWithParam { auto param = GetParam(); index_type = param.first; metric_type = param.second; - NB = 10000; - if (index_type == knowhere::IndexEnum::INDEX_HNSW) { + NB = 3000; + + // try to reduce the test time, + // but the large dataset is needed for the case below. + auto test_name = std::string( + testing::UnitTest::GetInstance()->current_test_info()->name()); + if (test_name == "Mmap" && + index_type == knowhere::IndexEnum::INDEX_HNSW) { NB = 270000; } build_conf = generate_build_conf(index_type, metric_type); @@ -352,7 +358,7 @@ class IndexTest : public ::testing::TestWithParam { std::vector xb_bin_data; knowhere::DataSetPtr xq_dataset; int64_t query_offset = 100; - int64_t NB = 10000; + int64_t NB = 3000; StorageConfig storage_config_; };