Skip to content

Commit 6162889

Browse files
committed
Use /api/version for test server health check
The health check was doing GET / and expecting 200, but with the SPA catch-all the root URL may not return 200 when the client build is skipped. Using /api/version instead is more reliable since it works regardless of client build state.
1 parent 77516a5 commit 6162889

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/galaxy_test/driver/driver_util.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -459,17 +459,16 @@ def get_webapp_global_conf():
459459

460460
def wait_for_http_server(host, port, prefix=None, sleep_amount=0.1, sleep_tries=150):
461461
"""Wait for an HTTP server to boot up."""
462-
# Test if the server is up
462+
# Use the API version endpoint for the health check since the root URL
463+
# may not return 200 (e.g. when the client build is skipped).
463464
prefix = prefix or "/"
464-
if not prefix.endswith("/"):
465-
prefix = f"{prefix}/"
465+
health_path = f"{prefix}api/version"
466466
for _ in range(sleep_tries):
467-
# directly test the app, not the proxy
468467
if port and isinstance(port, str):
469468
port = int(port)
470469
conn = http.client.HTTPConnection(host, port)
471470
try:
472-
conn.request("GET", prefix)
471+
conn.request("GET", health_path)
473472
response = conn.getresponse()
474473
if response.status == 200:
475474
break

0 commit comments

Comments
 (0)