#!/usr/bin/env python3 """Check real session expiry with TTL=2 and restore normal API configuration.""" import os from pathlib import Path import subprocess import sys import time ROOT = Path(__file__).resolve().parents[1] sys.path.insert(0,str(ROOT / 'tests')) from client import Client, Failure, check COMPOSE = ['docker','compose','--env-file','.env'] def compose(*args, env=None): subprocess.run(COMPOSE+list(args),cwd=ROOT,env=env,check=True, stdout=subprocess.DEVNULL) def ready(c): deadline=time.monotonic()+60 while time.monotonic()