Skip to content

Commit

Permalink
[CI] Deflake test metrics (#19711)
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-mo authored Oct 25, 2021
1 parent 045d72c commit 5330aab
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/ray/tests/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,16 @@ def test_multi_node_metrics_export_port_discovery(ray_start_cluster):
# Make sure we can ping Prometheus endpoints.
def test_prometheus_endpoint():
response = requests.get(
"http://localhost:{}".format(metrics_export_port))
"http://localhost:{}".format(metrics_export_port),
# Fail the request early on if connection timeout
timeout=0.01)
return response.status_code == 200

assert wait_until_succeeded_without_exception(
test_prometheus_endpoint, (requests.exceptions.ConnectionError, ))
test_prometheus_endpoint,
(requests.exceptions.ConnectionError, ),
# The dashboard takes more than 2s to startup.
timeout_ms=5000)


if __name__ == "__main__":
Expand Down

0 comments on commit 5330aab

Please sign in to comment.