Skip to content

Commit

Permalink
[fix][test] Fix test_vector_index_ivf_pq.cc bug.The reason is that there
Browse files Browse the repository at this point in the history
are duplicate IDs.
  • Loading branch information
Haijun Yu committed Apr 16, 2024
1 parent 1e70686 commit 1c1f2ef
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/unit_test/test_vector_index_ivf_pq.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1890,11 +1890,11 @@ TEST_F(VectorIndexIvfPqTest, AddForIvfPq) {

vector_with_ids.push_back(vector_with_id);

ok = vector_index_ivf_pq_l2->Add(vector_with_ids);
ok = vector_index_ivf_pq_l2->Upsert(vector_with_ids);
EXPECT_EQ(ok.error_code(), pb::error::Errno::OK);
ok = vector_index_ivf_pq_ip->Add(vector_with_ids);
ok = vector_index_ivf_pq_ip->Upsert(vector_with_ids);
EXPECT_EQ(ok.error_code(), pb::error::Errno::OK);
ok = vector_index_ivf_pq_cosine->Add(vector_with_ids);
ok = vector_index_ivf_pq_cosine->Upsert(vector_with_ids);
EXPECT_EQ(ok.error_code(), pb::error::Errno::OK);
}

Expand All @@ -1913,11 +1913,11 @@ TEST_F(VectorIndexIvfPqTest, AddForIvfPq) {
vector_with_ids.push_back(vector_with_id);
}

ok = vector_index_ivf_pq_l2->Add(vector_with_ids);
ok = vector_index_ivf_pq_l2->Upsert(vector_with_ids);
EXPECT_EQ(ok.error_code(), pb::error::Errno::OK);
ok = vector_index_ivf_pq_ip->Add(vector_with_ids);
ok = vector_index_ivf_pq_ip->Upsert(vector_with_ids);
EXPECT_EQ(ok.error_code(), pb::error::Errno::OK);
ok = vector_index_ivf_pq_cosine->Add(vector_with_ids);
ok = vector_index_ivf_pq_cosine->Upsert(vector_with_ids);
EXPECT_EQ(ok.error_code(), pb::error::Errno::OK);
}
}
Expand Down

0 comments on commit 1c1f2ef

Please sign in to comment.