Уточнить проверку срока сессии при перезапуске API
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user