Уточнить проверку срока сессии при перезапуске API

This commit is contained in:
2026-10-30 17:25:14 +03:00
parent a39b4fea27
commit ed5da7cdfb
2 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ bootstrap:
python3 scripts/bootstrap.py
up: bootstrap
docker compose up -d --build --wait
VCS_REF=$$(git rev-parse HEAD) docker compose up -d --build --wait
down:
docker compose down
+7 -1
View File
@@ -169,12 +169,18 @@ def main():
short_actor = short.user("expiry")
start = time.monotonic()
short.call("GET", "/api/v1/users/me", actor=short_actor, schema="User")
time.sleep(2.2)
time.sleep(1.0)
compose("-f", "compose.yaml", "-f", "compose.test.yaml", "restart", "api-short")
wait(short)
remaining = 2.2 - (time.monotonic() - start)
if remaining > 0:
time.sleep(remaining)
short.call("GET", "/api/v1/users/me", 401, actor=short_actor)
result["expiry"] = {
"configured_ttl_seconds": 2,
"observed_after_seconds": round(time.monotonic() - start, 4),
"expired_status": 401,
"short_api_restarted_before_check": True,
}
c.call("DELETE", "/api/v1/auth/sessions/current", 204, actor=alice)
c.call("GET", "/api/v1/users/me", 401, actor=alice)