Перенести собственную базу лабораторной 3 с сохранением задания и контракта

This commit is contained in:
2026-10-30 17:24:00 +03:00
parent ec540a1a72
commit 2e5f5bfe1b
23 changed files with 1121 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
"""Дождаться HTTP readiness перед запуском проверок."""
import argparse
import time
import urllib.request
parser=argparse.ArgumentParser()
parser.add_argument('--base-url',default='http://localhost:8080')
parser.add_argument('--replicas',type=int,default=1)
args=parser.parse_args()
observed=set()
for _ in range(120):
try:
with urllib.request.urlopen(args.base_url+'/health/ready',timeout=2) as response:
if response.status==200:
observed.add(response.headers.get('X-Instance-Id'))
if len(observed)>=args.replicas:
print('PASS: API ready, replicas:', len(observed))
break
time.sleep(0.1)
except Exception:
time.sleep(0.5)
else:
raise SystemExit('API readiness timeout')