From 8846b0554e9dc1cf53184249f649181870d1f4f5 Mon Sep 17 00:00:00 2001 From: gWalut Date: Sun, 1 Nov 2026 17:15:45 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D1=8F?= =?UTF-8?q?=D1=82=D1=8C=20=D0=B7=D0=B0=D0=BF=D1=83=D1=89=D0=B5=D0=BD=D0=BD?= =?UTF-8?q?=D1=8B=D0=B9=20TTL-=D0=BA=D0=BE=D0=BD=D1=82=D0=B5=D0=B9=D0=BD?= =?UTF-8?q?=D0=B5=D1=80=20=D0=BF=D1=80=D0=B8=20=D1=82=D0=B0=D0=B9=D0=BC?= =?UTF-8?q?=D0=B0=D1=83=D1=82=D0=B5=20Compose=20Desktop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitattributes | 1 + scripts/verify.py | 21 ++++++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.gitattributes b/.gitattributes index 4209e671..beda37c9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,3 +3,4 @@ *.sql text eol=lf *.yaml text eol=lf *.cfg text eol=lf +evidence/* -whitespace diff --git a/scripts/verify.py b/scripts/verify.py index b7be4da3..1f64f93b 100644 --- a/scripts/verify.py +++ b/scripts/verify.py @@ -66,12 +66,27 @@ def main(): print("Checking short session expiry and indexed history", flush=True) ttl_name = config["name"] + "-ttl-check" assert not command(["docker", "ps", "-a", "--filter", "name=^/" + ttl_name + "$", "--format", "{{.ID}}"]) + created = False try: - compose("run", "-d", "--no-deps", "--name", ttl_name, "-e", "SESSION_TTL_SECONDS=2", "api") + try: + compose("run", "-d", "--no-deps", "--name", ttl_name, + "-e", "SESSION_TTL_SECONDS=2", "api", timeout=45) + except subprocess.TimeoutExpired: + # A detached Compose command on Desktop can time out after Docker + # already started its container. Inspect the unique name rather + # than create another process or treat an unknown startup as PASS. + row = json.loads(command(["docker", "inspect", ttl_name]))[0] + labels = row["Config"]["Labels"] + assert labels["com.docker.compose.project"] == config["name"] + assert labels["com.docker.compose.service"] == "api" + assert "SESSION_TTL_SECONDS=2" in row["Config"]["Env"] + assert row["State"]["Running"], "TTL container did not start" + created = True checks("expiry.txt", "env", "EXPIRY_BASE_URL=http://" + ttl_name + ":8080", "python", "scripts/check_expiry.py") finally: - command(["docker", "stop", "--time", "6", ttl_name]) - command(["docker", "rm", ttl_name]) + if created: + command(["docker", "stop", "--time", "6", ttl_name]) + command(["docker", "rm", ttl_name]) checks("explain-run.txt", "make", "explain") checks("smoke-final.txt", "make", "test") saved("published-smoke.txt", [sys.executable, "-X", "utf8", "tests/smoke.py", "--base-url", base_url])