Skip to content

Commit

Permalink
fix: remove flakyness from elastic tests (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
alaeddine-13 authored Mar 31, 2022
1 parent 4722268 commit 0cae644
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/unit/array/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import time

import pytest
from elasticsearch import Elasticsearch

cur_dir = os.path.dirname(os.path.abspath(__file__))
compose_yml = os.path.abspath(os.path.join(cur_dir, 'docker-compose.yml'))
Expand All @@ -13,7 +14,10 @@ def start_storage():
f"docker-compose -f {compose_yml} --project-directory . up --build -d "
f"--remove-orphans"
)
time.sleep(20)
es = Elasticsearch(hosts='http://localhost:9200/')
while not es.ping():
time.sleep(0.5)

yield
os.system(
f"docker-compose -f {compose_yml} --project-directory . down "
Expand Down

0 comments on commit 0cae644

Please sign in to comment.