Bypass proxies for blackbox healthcheck

This commit is contained in:
Daniel Schädler 2026-04-11 16:34:32 +02:00
parent a3e1f3b05c
commit 7f07ededcf
2 changed files with 4 additions and 1 deletions

View File

@ -61,6 +61,8 @@ rails e2e spec:
MAILGUN_DOMAIN: blackbox.example.com MAILGUN_DOMAIN: blackbox.example.com
RAILS_LOG_TO_STDOUT: "1" RAILS_LOG_TO_STDOUT: "1"
RAILS_SERVE_STATIC_FILES: "1" RAILS_SERVE_STATIC_FILES: "1"
NO_PROXY: app,postgres,localhost,127.0.0.1
no_proxy: app,postgres,localhost,127.0.0.1
TURNIERE_E2E_BASE_URL: http://app:3000 TURNIERE_E2E_BASE_URL: http://app:3000
TURNIERE_E2E_EMAIL: e2e@example.com TURNIERE_E2E_EMAIL: e2e@example.com
TURNIERE_E2E_PASSWORD: password123 TURNIERE_E2E_PASSWORD: password123

View File

@ -45,10 +45,11 @@ def _env(**overrides):
def _wait_for_http(base_url=TEST_BASE_URL, timeout=60): def _wait_for_http(base_url=TEST_BASE_URL, timeout=60):
deadline = time.time() + timeout deadline = time.time() + timeout
healthz_url = f"{base_url}/healthz" healthz_url = f"{base_url}/healthz"
opener = urllib.request.build_opener(urllib.request.ProxyHandler({}))
while time.time() < deadline: while time.time() < deadline:
try: try:
with urllib.request.urlopen(healthz_url) as response: with opener.open(healthz_url) as response:
if response.status == 200: if response.status == 200:
return return
except Exception: except Exception: