Skip to content

Commit

Permalink
simplify test
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasht86 committed Nov 22, 2024
1 parent bd29500 commit d9fde8d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/integration/test_integration_vespa_cloud_vector_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ def test_vector_indexing_and_query(self):
docs = list(
pyvespa_feed_format
) # we have enough memory to page everything into memory with list()
# seems like we sometimes can get more than sample_size docs
if len(docs) > sample_size:
docs = docs[:sample_size]
self.assertEqual(len(docs), sample_size)
ok = 0
callbacks = 0
start_time = time.time()
Expand All @@ -126,9 +130,6 @@ def callback(response: VespaResponse, id: str):
schema="vector",
namespace="benchmark",
callback=callback,
max_workers=48,
max_connections=48,
max_queue_size=4000,
)
self.assertEqual(ok, sample_size)
duration = time.time() - start
Expand Down Expand Up @@ -171,13 +172,14 @@ def callback(response: VespaResponse, id: str):
}
)
faulty_docs = list(feed_with_wrong_field)
if len(faulty_docs) > sample_size:
faulty_docs = faulty_docs[:sample_size]
self.assertEqual(len(faulty_docs), sample_size)
self.app.feed_iterable(
iter=faulty_docs,
schema="vector",
namespace="benchmark",
callback=callback,
max_workers=48,
max_connections=48,
)
self.assertEqual(ok, 0)
self.assertEqual(callbacks, 100)
Expand Down

0 comments on commit d9fde8d

Please sign in to comment.