Repository navigation
Wait for the image alias's pull before testImageAlias's health check - #8191
Merged
Merged
Conversation
testImageAlias starts a container from `cloudflare/debian-trixie`, which resolves to a node:24.20.0-trixie-slim manifest (85 MB compressed) that start() pulls from Docker Hub when the engine doesn't have it. The container tests run on a fresh Docker engine per test variant, so every run pulls it. start() is fire-and-forget, so the health check's first fetch was issued while the pull was still running, and its 10 second AbortSignal.timeout covered the pull. When the pull took longer, the fetch was aborted with a TimeoutError, which the health check rethrows rather than retrying, failing the test. inspect() takes its RPC turn after start(), so awaiting it first waits out the pull with no per-request timeout. The health check then only waits for the server in the container to listen.
There was a problem hiding this comment.
✅ Approved — A one-file test change that correctly waits out the image pull before the health check. No findings.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
📋 Code Quality: ✅ LGTM
The fix relies on inspect() waiting for start() to finish, and the server code supports that: both go through the same RPC turn. The comment follows the repository's comment guidelines.
Reviewed commit: e17e14e0
danlapid
approved these changes
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
container-client-test:testImageAliasfails intermittently onmain, in whichever varianthappens to be slow that run, with
TimeoutError: The operation was aborted due to timeoutafter 10 seconds:@on 5faa2a5@and@all-compat-flagson 03cd4c7@all-autogateson d85a6b0 and b1173d8This PR makes the test wait for
start()to finish before its health check.Cause
cloudflare/debian-trixiealias. It resolves todocker.io/library/node:24.20.0-trixie-slim@sha256:a747…, a linux/amd64 manifest with 85 MB ofcompressed layers.
start()pulls the image when the engine doesn't have it (ensureSystemImageAvailable()). Thecontainer tests run on a fresh Docker engine per variant, so every run pulls it from Docker Hub.
start()is fire-and-forget. The health check's firstgetTcpPort(8080).fetch()is issued whilethe pull is still running, and its
AbortSignal.timeout(10_000)covers the pull.waitUntilContainerIsHealthy()rethrows anything other than "not listening", so it doesn't retry.
Fix
inspect()takes its RPC turn afterstart(), so awaiting it first waits out the pull with noper-request timeout. The health check then only waits for the server in the container to listen.
The
inspect()assertion moves ahead of the health check. It checks the alias reported for thestarted container, which doesn't depend on the server listening.
Testing
On bazelflare,
--runs_per_test=3of all three variants, each on a fresh engine:testImageAliasrunsTimeoutError)bazel test --config=bazelflare //...passes.Notes
The test still pulls from Docker Hub on every run. I looked at preloading the image with the other
test images, but a
docker loaded copy doesn't satisfy thename:tag@sha256:a747…checkensureSystemImageAvailable()does:docker loadrecords a synthesized digest foroci_load'sdocker-format tarball, or the wrapping index's digest for
format = "oci".docker loadrecords no digest.An OCI layout whose
index.jsonpoints straight at the manifest does work, on the containerdstore only.
oci_loaddoesn't produce one, so that would need a custom rule.