Simplify navigation and modernize profile and sign-in
This commit is contained in:
@@ -47,18 +47,30 @@ echo "Running remote beta smoke checks"
|
||||
ssh ${ssh_opts} "${remote}" "
|
||||
set -e
|
||||
python3 - <<'PY'
|
||||
from urllib import request
|
||||
import time
|
||||
from urllib import error, request
|
||||
|
||||
checks = [
|
||||
('http://127.0.0.1:8100/health', 200),
|
||||
('http://${beta_frontend_bind}:3100/login', 200),
|
||||
]
|
||||
|
||||
# Compose returns before the app is ready. Allow the new processes to start
|
||||
# instead of reporting a failed deployment on the first connection reset.
|
||||
deadline = time.monotonic() + 90
|
||||
for url, expected in checks:
|
||||
with request.urlopen(url, timeout=20) as response:
|
||||
if response.status != expected:
|
||||
raise SystemExit(f'{url} returned {response.status}, expected {expected}')
|
||||
print(url, response.status)
|
||||
while True:
|
||||
try:
|
||||
with request.urlopen(url, timeout=5) as response:
|
||||
if response.status != expected:
|
||||
raise OSError(f'HTTP {response.status}, expected {expected}')
|
||||
print(url, response.status)
|
||||
break
|
||||
except (error.URLError, OSError, TimeoutError) as exc:
|
||||
if time.monotonic() >= deadline:
|
||||
raise SystemExit(f'Beta did not become ready: {url}: {exc}') from exc
|
||||
print(f'Waiting for beta to start: {url}', flush=True)
|
||||
time.sleep(2)
|
||||
PY
|
||||
"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user