mirror of
https://github.com/logos-messaging/logos-messaging-interop-tests.git
synced 2026-01-08 17:03:12 +00:00
fix: check_healthy accepts both text and json response
This commit is contained in:
parent
13f8e70100
commit
9705029ead
@ -26,7 +26,7 @@ class REST(BaseClient):
|
||||
|
||||
def health(self):
|
||||
health_response = self.rest_call("get", "health")
|
||||
return health_response.json()
|
||||
return health_response.content
|
||||
|
||||
def get_peers(self):
|
||||
get_peers_response = self.rest_call("get", "admin/v1/peers")
|
||||
|
||||
@ -190,6 +190,15 @@ class WakuNode:
|
||||
@retry(stop=stop_after_delay(timeout_duration), wait=wait_fixed(0.1), reraise=True)
|
||||
def check_healthy(node=self):
|
||||
self.health_response = node.health()
|
||||
if self.health_response == b"Node is healthy":
|
||||
logger.info("Node is healthy !!")
|
||||
return
|
||||
else:
|
||||
try:
|
||||
self.health_response = json.loads(self.health_response)
|
||||
except Exception as ex:
|
||||
raise AttributeError(f"Unknown health response format {ex}")
|
||||
|
||||
if self.health_response["nodeHealth"] and self.health_response["nodeHealth"] != "Ready":
|
||||
raise AssertionError("Waiting for the node health status: Ready")
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user