From 6c30f06c4162bcf639153edef09c0d8e416130de Mon Sep 17 00:00:00 2001 From: Edgar Arakelyan Date: Mon, 16 Nov 2026 21:04:40 -0800 Subject: [PATCH 1/2] test(computer): the framework-only routes test sends from a pinned image, and docker's errors say why The test's request from another container ran an unpinned public.ecr.aws python image, and docker run exited 125 before the request on main's CI four times recently, the last keeping v0.9.1551 off PyPI. It now runs the digest-pinned mirror.gcr.io image the test Dockerfiles use, and the computer tests' docker helper adds docker's stderr to its error. Co-Authored-By: Claude Opus 5.5 --- tst/integration/computer/computer_env_test.py | 5 +++-- tst/integration/computer/conftest.py | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tst/integration/computer/computer_env_test.py b/tst/integration/computer/computer_env_test.py index 8b1e58cc7..0da7874b3 100644 --- a/tst/integration/computer/computer_env_test.py +++ b/tst/integration/computer/computer_env_test.py @@ -55,6 +55,8 @@ ARCH = {"x86_64": "amd64", "amd64": "amd64", "aarch64": "arm64", "arm64": "arm64"}[platform.machine().lower()] PORT = 18765 +#: The image a container on this machine's network sends a request from, pinned, from the mirror the test images use. +PYTHON = "mirror.gcr.io/library/python:3.12-slim@sha256:423ed6ab25b1921a477529254bfeeabf5855151dc2c3141699a1bfc852199fbf" READ_NOTE = b"""import json, urllib.request def run(input): with urllib.request.urlopen(input["env"]["url"] + "/.well-known/agent-env.json", timeout=10) as response: @@ -279,8 +281,7 @@ def _post_from_a_container(url: str, body: dict) -> int: "headers={'Content-Type': 'application/json'})\n" "try:\n print(urllib.request.urlopen(request, timeout=30).status)\n" "except urllib.error.HTTPError as e:\n print(e.code)\n") - out = docker("run", "--rm", "--network", "host", "public.ecr.aws/docker/library/python:3.12-slim", - "python", "-c", script, url, json.dumps(body)) + out = docker("run", "--rm", "--network", "host", PYTHON, "python", "-c", script, url, json.dumps(body)) return int(out.stdout.decode().strip()) diff --git a/tst/integration/computer/conftest.py b/tst/integration/computer/conftest.py index 64475b975..6eacffbd5 100644 --- a/tst/integration/computer/conftest.py +++ b/tst/integration/computer/conftest.py @@ -180,7 +180,12 @@ def _composed(root: Path, bundle, env_id: str | None = None): def docker(*args: str) -> subprocess.CompletedProcess: - return subprocess.run(["docker", *args], check=True, capture_output=True) + """``docker`` with ``args``; a failure carries docker's own error, which the exception alone doesn't show.""" + try: + return subprocess.run(["docker", *args], check=True, capture_output=True) + except subprocess.CalledProcessError as e: + e.add_note(f"docker's stderr: {e.stderr.decode(errors='replace')[-2000:]}") + raise @pytest.fixture From ec1cc42ad20ea0bb59ef97bba1961a699a7a6d09 Mon Sep 17 00:00:00 2001 From: Edgar Arakelyan Date: Mon, 16 Nov 2026 21:07:12 -0800 Subject: [PATCH 2/2] test(computer): name how much of docker's stderr a failed call carries Co-Authored-By: Claude Opus 5.5 --- tst/integration/computer/conftest.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tst/integration/computer/conftest.py b/tst/integration/computer/conftest.py index 6eacffbd5..8af4a3a72 100644 --- a/tst/integration/computer/conftest.py +++ b/tst/integration/computer/conftest.py @@ -179,12 +179,16 @@ def _composed(root: Path, bundle, env_id: str | None = None): patch.undo() +#: How many characters of docker's stderr a failed call's error carries: the last, where docker says what failed. +DOCKER_ERROR_CHARS = 2000 + + def docker(*args: str) -> subprocess.CompletedProcess: """``docker`` with ``args``; a failure carries docker's own error, which the exception alone doesn't show.""" try: return subprocess.run(["docker", *args], check=True, capture_output=True) except subprocess.CalledProcessError as e: - e.add_note(f"docker's stderr: {e.stderr.decode(errors='replace')[-2000:]}") + e.add_note(f"docker's stderr: {e.stderr.decode(errors='replace')[-DOCKER_ERROR_CHARS:]}") raise