Bypass proxies for blackbox healthcheck
This commit is contained in:
parent
a3e1f3b05c
commit
7f07ededcf
|
|
@ -61,6 +61,8 @@ rails e2e spec:
|
|||
MAILGUN_DOMAIN: blackbox.example.com
|
||||
RAILS_LOG_TO_STDOUT: "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_EMAIL: e2e@example.com
|
||||
TURNIERE_E2E_PASSWORD: password123
|
||||
|
|
|
|||
3
tasks.py
3
tasks.py
|
|
@ -45,10 +45,11 @@ def _env(**overrides):
|
|||
def _wait_for_http(base_url=TEST_BASE_URL, timeout=60):
|
||||
deadline = time.time() + timeout
|
||||
healthz_url = f"{base_url}/healthz"
|
||||
opener = urllib.request.build_opener(urllib.request.ProxyHandler({}))
|
||||
|
||||
while time.time() < deadline:
|
||||
try:
|
||||
with urllib.request.urlopen(healthz_url) as response:
|
||||
with opener.open(healthz_url) as response:
|
||||
if response.status == 200:
|
||||
return
|
||||
except Exception:
|
||||
|
|
|
|||
Loading…
Reference in New Issue