Skip to content

Commit cad9594

Browse files
committed
fix: remove flakyness from elastic tests
1 parent 4722268 commit cad9594

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/unit/array/conftest.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import time
33

44
import pytest
5+
from elasticsearch import Elasticsearch
56

67
cur_dir = os.path.dirname(os.path.abspath(__file__))
78
compose_yml = os.path.abspath(os.path.join(cur_dir, 'docker-compose.yml'))
@@ -13,7 +14,10 @@ def start_storage():
1314
f"docker-compose -f {compose_yml} --project-directory . up --build -d "
1415
f"--remove-orphans"
1516
)
16-
time.sleep(20)
17+
es = Elasticsearch(hosts='http://localhost:9200/')
18+
while not es.ping():
19+
time.sleep(0.5)
20+
1721
yield
1822
os.system(
1923
f"docker-compose -f {compose_yml} --project-directory . down "

0 commit comments

Comments
 (0)