Skip to content

Commit 7d81fa9

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

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/logging_test.py

+12
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,18 @@ 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+
def check_endpoint():
65+
try:
66+
response = requests.get("http://localhost:3000/login") # Should only return 200 when ready
67+
return response.status_code == 200
68+
except requests.RequestException:
69+
return False
70+
self.wait_for_predicate(check_endpoint, timeout=120)
71+
self.log.info("Grafana login endpoint returned status code 200")
6072

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

0 commit comments

Comments
 (0)