Skip to content

Commit f32a8ce

Browse files
Apply suggestion from @coderabbitai[bot]
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent f2721ae commit f32a8ce

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

key-value/key-value-aio/tests/stores/elasticsearch/test_elasticsearch.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,13 @@ async def ping_elasticsearch() -> bool:
4646
async with es_client:
4747
if await es_client.ping():
4848
logger.info("Elasticsearch pinged, wait for yellow status")
49-
await es_client.cluster.health(wait_for_status="yellow", timeout="10s")
50-
logger.info("Elasticsearch is ready")
51-
return True
49+
try:
50+
await es_client.cluster.health(wait_for_status="yellow", timeout="10s")
51+
logger.info("Elasticsearch is ready")
52+
return True
53+
except Exception as e:
54+
logger.warning(f"Cluster health check failed: {e}")
55+
return False
5256
return False
5357

5458

0 commit comments

Comments
 (0)