@@ -369,6 +369,8 @@ private static Stream<Arguments> provideSearchParameters() {
369369 );
370370 }
371371
372+ private final String indexingFailureMessage = "If you are running in a slow machine, data might not be indexed yet. Adjust setup delay if needed" ;
373+
372374 @ ParameterizedTest
373375 @ MethodSource ("provideSearchParameters" )
374376 public void search (RecordCollectionOptions options , String embeddingName ) {
@@ -385,9 +387,9 @@ public void search(RecordCollectionOptions options, String embeddingName) {
385387 // Embeddings similar to the third hotel
386388 List <VectorSearchResult <Hotel >> results = recordCollection .searchAsync (SEARCH_EMBEDDINGS , searchOptions ).block ();
387389 assertNotNull (results );
388- assertEquals (VectorSearchOptions .DEFAULT_RESULT_LIMIT , results .size ());
390+ assertEquals (VectorSearchOptions .DEFAULT_RESULT_LIMIT , results .size (), indexingFailureMessage );
389391 // The third hotel should be the most similar
390- assertEquals (hotels .get (2 ).getId (), results .get (0 ).getRecord ().getId ());
392+ assertEquals (hotels .get (2 ).getId (), results .get (0 ).getRecord ().getId (), indexingFailureMessage );
391393 // Score should be different than zero
392394 assertNotEquals (0.0 , results .get (0 ).getScore ());
393395 assertNull (results .get (0 ).getRecord ().getEuclidean ());
@@ -410,9 +412,9 @@ public void searchWithVectors(RecordCollectionOptions options, String embeddingN
410412 // Embeddings similar to the third hotel
411413 List <VectorSearchResult <Hotel >> results = recordCollection .searchAsync (SEARCH_EMBEDDINGS , searchOptions ).block ();
412414 assertNotNull (results );
413- assertEquals (VectorSearchOptions .DEFAULT_RESULT_LIMIT , results .size ());
415+ assertEquals (VectorSearchOptions .DEFAULT_RESULT_LIMIT , results .size (), indexingFailureMessage );
414416 // The third hotel should be the most similar
415- assertEquals (hotels .get (2 ).getId (), results .get (0 ).getRecord ().getId ());
417+ assertEquals (hotels .get (2 ).getId (), results .get (0 ).getRecord ().getId (), indexingFailureMessage );
416418 assertNotNull (results .get (0 ).getRecord ().getEuclidean ());
417419 }
418420
@@ -434,8 +436,8 @@ public void searchWithOffSet(RecordCollectionOptions options, String embeddingNa
434436 // Embeddings similar to the third hotel
435437 List <VectorSearchResult <Hotel >> results = recordCollection .searchAsync (SEARCH_EMBEDDINGS , searchOptions ).block ();
436438 assertNotNull (results );
437- assertEquals (4 , results .size ());
439+ assertEquals (4 , results .size (), indexingFailureMessage );
438440 // The first hotel should be the most similar
439- assertEquals (hotels .get (0 ).getId (), results .get (0 ).getRecord ().getId ());
441+ assertEquals (hotels .get (0 ).getId (), results .get (0 ).getRecord ().getId (), indexingFailureMessage );
440442 }
441443}
0 commit comments