diff --git a/CHANGELOG.md b/CHANGELOG.md index f8830194ac4fe2f1ff7a22e65b19506f0fcb694b..9baa62a78d1b20a218796589ad5e233db0ff862b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ Please mark all change in change log and use the ticket from JIRA. - \#649 - Typo "partiton" should be "partition" - \#654 - Random crash when frequently insert vector one by one - \#658 - Milvus error out when building SQ8H index without GPU resources +- \#670 - Random failure of unittest db_test::SEARCH_TEST ## Feature - \#12 - Pure CPU version for Milvus diff --git a/core/unittest/db/test_db.cpp b/core/unittest/db/test_db.cpp index 768687a8a3d75693033049f9602a9c4203c35284..dbed92b355e0ec838e5e314ba7efdf923a61718c 100644 --- a/core/unittest/db/test_db.cpp +++ b/core/unittest/db/test_db.cpp @@ -338,7 +338,13 @@ TEST_F(DBTest, SEARCH_TEST) { { // search by specify index file milvus::engine::meta::DatesT dates; - std::vector file_ids = {"1", "2", "3", "4", "5", "6"}; + std::vector file_ids; + // sometimes this case run fast to merge file and build index, old file will be deleted immediately, + // so the QueryByFileID cannot get files to search + // input 100 files ids to avoid random failure of this case + for (int i = 0; i < 100; i++) { + file_ids.push_back(std::to_string(i)); + } milvus::engine::ResultIds result_ids; milvus::engine::ResultDistances result_distances; stat = db_->QueryByFileID(TABLE_NAME, file_ids, k, nq, 10, xq.data(), dates, result_ids, result_distances);