@@ -73,7 +73,9 @@ struct SVSIndexType {
73
73
74
74
// clang-format off
75
75
using SVSDataTypeSet = ::testing::Types<SVSIndexType<VecSimType_FLOAT32, float , VecSimSvsQuant_NONE>
76
- // ,SVSIndexType<VecSimType_FLOAT32, float, VecSimSvsQuant_8>
76
+ #if HAVE_SVS_LVQ
77
+ ,SVSIndexType<VecSimType_FLOAT32, float , VecSimSvsQuant_8>
78
+ #endif
77
79
>;
78
80
// clang-format on
79
81
@@ -139,7 +141,7 @@ TYPED_TEST(SVSTieredIndexTest, ThreadsReservation) {
139
141
// The number of reserved threads should be equal to requested
140
142
ASSERT_EQ (num_reserved_threads, num_threads - 2 );
141
143
142
- // Request and more threads than available
144
+ // Request more threads than available
143
145
jobs = SVSMultiThreadJob::createJobs (allocator, HNSW_INSERT_VECTOR_JOB, update_job_mock,
144
146
tiered_index, num_threads + 2 , timeout);
145
147
tiered_index->submitJobs (jobs);
@@ -214,7 +216,7 @@ TYPED_TEST(SVSTieredIndexTest, addVector) {
214
216
ASSERT_EQ (tiered_index->GetFlatIndex ()->indexSize (), 1 );
215
217
ASSERT_EQ (tiered_index->GetBackendIndex ()->indexSize (), 0 );
216
218
ASSERT_EQ (tiered_index->GetFlatIndex ()->indexCapacity (), DEFAULT_BLOCK_SIZE);
217
- ASSERT_EQ (tiered_index->indexCapacity (), DEFAULT_BLOCK_SIZE + 1 );
219
+ ASSERT_EQ (tiered_index->indexCapacity (), DEFAULT_BLOCK_SIZE);
218
220
ASSERT_EQ (tiered_index->GetFlatIndex ()->getDistanceFrom_Unsafe (vec_label, vector), 0 );
219
221
ASSERT_EQ (mock_thread_pool.jobQ .size (), mock_thread_pool.thread_pool_size );
220
222
// Validate that the job was created properly
@@ -264,7 +266,10 @@ TYPED_TEST(SVSTieredIndexTest, insertJob) {
264
266
ASSERT_EQ (tiered_index->GetBackendIndex ()->indexSize (), 1 );
265
267
// SVS index should have allocated a single record, while flat index should remove the
266
268
// block.
267
- ASSERT_EQ (tiered_index->indexCapacity (), DEFAULT_BLOCK_SIZE);
269
+ // LVQDataset does not provide a capacity method
270
+ const size_t expected_capacity =
271
+ TypeParam::get_quant_bits () > 0 ? tiered_index->indexSize () : DEFAULT_BLOCK_SIZE;
272
+ ASSERT_EQ (tiered_index->indexCapacity (), expected_capacity);
268
273
ASSERT_EQ (tiered_index->GetFlatIndex ()->indexCapacity (), 0 );
269
274
ASSERT_EQ (tiered_index->getDistanceFrom_Unsafe (vec_label, vector), 0 );
270
275
}
@@ -287,7 +292,7 @@ TYPED_TEST(SVSTieredIndexTest, insertJobAsync) {
287
292
GenerateAndAddVector<TEST_DATA_T>(tiered_index, dim, i, i);
288
293
}
289
294
290
- mock_thread_pool.thread_pool_join ();
295
+ mock_thread_pool.thread_pool_wait ();
291
296
ASSERT_EQ (tiered_index->indexSize (), n);
292
297
ASSERT_EQ (mock_thread_pool.jobQ .size (), 0 );
293
298
auto sz_f = tiered_index->GetFlatIndex ()->indexSize ();
@@ -302,6 +307,7 @@ TYPED_TEST(SVSTieredIndexTest, insertJobAsync) {
302
307
<< " Vector label: " << i;
303
308
}
304
309
310
+ mock_thread_pool.thread_pool_join ();
305
311
// Verify that all vectors were moved to SVS as expected
306
312
sz_f = tiered_index->GetFlatIndex ()->indexSize ();
307
313
sz_b = tiered_index->GetBackendIndex ()->indexSize ();
0 commit comments