Skip to content

Commit b3f7eeb

Browse files
committed
add liveness check to test_logging.py
1 parent 734fbb3 commit b3f7eeb

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/logging_test.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,20 @@ def setup_network(self):
5757
self.log.info(self.warcli(f"deploy {self.network_dir}"))
5858
self.wait_for_all_tanks_status(target="running", timeout=10 * 60)
5959
self.wait_for_all_edges()
60+
self.wait_for_endpoint_ready()
61+
62+
def wait_for_endpoint_ready(self):
63+
self.log.info("Waiting for Grafana to be ready to receive API calls...")
64+
65+
def check_endpoint():
66+
try:
67+
response = requests.get("http://localhost:3000/login")
68+
return response.status_code == 200
69+
except requests.RequestException:
70+
return False
71+
72+
self.wait_for_predicate(check_endpoint, timeout=120)
73+
self.log.info("Grafana login endpoint returned status code 200")
6074

6175
def make_grafana_api_request(self, ds_uid, start, metric):
6276
self.log.info("Making Grafana request...")

0 commit comments

Comments
 (0)