Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix flaky integration test #2775

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import pytest

from elasticsearch import AsyncElasticsearch
from test_elasticsearch.test_dsl.async_sleep import sleep

from ..async_examples import vectors

Expand All @@ -48,9 +47,6 @@ def encode(self, text: str) -> List[float]:
mocker.patch.object(vectors, "SentenceTransformer", new=MockModel)

await vectors.create()
for i in range(10):
results = await (await vectors.search("Welcome to our team!")).execute()
if len(results.hits) > 0:
break
await sleep(0.1)
await vectors.WorkplaceDoc._index.refresh()
results = await (await vectors.search("Welcome to our team!")).execute()
assert results[0].name == "New Employee Onboarding Guide"
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import pytest

from elasticsearch import Elasticsearch
from test_elasticsearch.test_dsl.sleep import sleep

from ..examples import vectors

Expand All @@ -48,9 +47,6 @@ def encode(self, text: str) -> List[float]:
mocker.patch.object(vectors, "SentenceTransformer", new=MockModel)

vectors.create()
for i in range(10):
results = (vectors.search("Welcome to our team!")).execute()
if len(results.hits) > 0:
break
sleep(0.1)
vectors.WorkplaceDoc._index.refresh()
results = (vectors.search("Welcome to our team!")).execute()
assert results[0].name == "New Employee Onboarding Guide"