From 877809f853b89bc467b33044ae3120750ab1181e Mon Sep 17 00:00:00 2001 From: alonre24 Date: Tue, 16 Jan 2024 11:43:15 +0200 Subject: [PATCH] Fix flaky (#425) --- tests/unit/test_hnsw_tiered.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/unit/test_hnsw_tiered.cpp b/tests/unit/test_hnsw_tiered.cpp index 15e7c03ff..0625bdc36 100644 --- a/tests/unit/test_hnsw_tiered.cpp +++ b/tests/unit/test_hnsw_tiered.cpp @@ -3071,8 +3071,11 @@ TYPED_TEST(HNSWTieredIndexTest, bufferLimitAsync) { TypeParam::isMulti() ? 1 : 1 - overwrite); EXPECT_LE(tiered_index->frontendIndex->indexSize(), flat_buffer_limit); } + // In first run, wait until all vectors are moved from flat index to HNSW backend index. + while (tiered_index->backendIndex->indexSize() < n) { + /*do nothing*/ + } } - mock_thread_pool.thread_pool_join(); EXPECT_EQ(tiered_index->backendIndex->indexSize(), 2 * n); EXPECT_EQ(tiered_index->indexLabelCount(), n_labels);