Repository navigation
test: the bootstrap images are built one worker at a time - #610
Open
earakely-scale wants to merge 1 commit into
Open
earakely-scale wants to merge 1 commit into
earakely-scale wants to merge 1 commit into
Conversation
Test workers share one Docker daemon, and two first builds of one tag at the same moment both create it, so the second fails with "image ...: already exists". _seed_bootstrap_envs, which about a dozen integration test files call, builds four fixed tags; it now holds a lock while it builds each. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
What and why
integration-local-slowfails now and then at_seed_bootstrap_envs()with a build error:It hit main in shard 10 (run 42921640696,
db-mcp-default-db), and #598 twice in a row in the same shard (db-mcp-default-db, thengateway-default)._seed_bootstrap_envs()builds four images under fixed tags:service-db-default-db,db-web-default-db,db-mcp-default-dbandgateway-default. About a dozen integration test files call it, and since #600 the slow tier runs them two at a time on each shard, on workers that share one Docker daemon. In #598's failed shard, gw0 startedlocal_parallel_deploy_testand gw1 startedtest_advance_to_next_event_hook_localabout 20 s later. Both built the same four images in the same order.When a tag doesn't exist yet, as on a fresh runner, BuildKit names the image by creating the tag. Two first builds of one tag at the same moment both try to create it, and the one that comes second fails with "already exists".
What changes
_seed_bootstrap_envs()holds an exclusivefcntl.flockon one lock file in the temp directory while it builds each image, so workers take turns. The tests already use this pattern for their shared wheel cache (tst/installer/conftest.py). The tags stay fixed, so no extra tags pile up on a developer's machine. Once one worker has built an image, the next worker's build comes from the layer cache, so waiting costs a few seconds.Tests only, so no release.
How it was tested
On an Ubuntu 24.04 VM in agent-environments-admin with Docker 29.1.3 on the containerd image store, as on CI:
image "docker.io/library/race-repro-gw:latest": already exists.-n 4): the two that collided in feat(multi): a multi env names its website browser (browser_envs), a browser computer on a sandbox of its own #598's shard,local_parallel_deploy_test.pyandtest_advance_to_next_event_hook_local.py, plusmulti_env_local_test.pyandbuild_context_local_test.py._seed_bootstrap_envs, starting with none of the four tags: one of 2 runs failed as on CI,image "docker.io/library/db-mcp-default-db:latest": already exists, 1 failed and 5 passed.ruff checkpasses on the file.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge.Summary
The PR makes bootstrap image builds take turns across test workers that share a Docker daemon.
Reviews (4) · Last reviewed commit: "test: the bootstrap images are built one..." · Reviewed by Greptile