File tree Expand file tree Collapse file tree 1 file changed +25
-9
lines changed
Expand file tree Collapse file tree 1 file changed +25
-9
lines changed Original file line number Diff line number Diff line change 22
33from typing import AsyncContextManager
44
5- from elasticsearch import Elasticsearch
5+ from elasticsearch import (
6+ Elasticsearch ,
7+ ConnectionError ,
8+ )
69from piker .service import marketstore
710
811
@@ -45,8 +48,8 @@ async def main():
4548 if cs .cancelled_caught :
4649 continue
4750
48-
49- # should be an empty db?
51+ # should be an empty db (for now) since we spawn
52+ # marketstore in a ephemeral test-harness dir.
5053 assert not syms
5154 print (f'RX syms resp: { syms } ' )
5255
@@ -72,12 +75,25 @@ def test_elasticsearch_startup_and_version(
7275 async def main ():
7376 port = 19200
7477
75- async with open_test_pikerd (
76- loglevel = loglevel ,
77- es = True
78- ) as (s , i , pikerd_portal , services ):
78+ async with (
79+ open_test_pikerd (
80+ loglevel = loglevel ,
81+ es = True
82+ ) as (
83+ _ , # host
84+ _ , # port
85+ pikerd_portal ,
86+ services ,
87+ ),
88+ ):
89+
90+ for _ in range (240 ):
91+ try :
92+ es = Elasticsearch (hosts = [f'http://localhost:{ port } ' ])
93+ except ConnectionError :
94+ await trio .sleep (1 )
95+ continue
7996
80- es = Elasticsearch (hosts = [f'http://localhost:{ port } ' ])
81- assert es .info ()['version' ]['number' ] == '7.17.4'
97+ assert es .info ()['version' ]['number' ] == '7.17.4'
8298
8399 trio .run (main )
You can’t perform that action at this time.
0 commit comments