Skip to content

test(cloudflare): let the Docker stub read the Dockerfile from stdin - #697

Merged
Brooooooklyn merged 1 commit into
mainfrom
fix/container-build-test-epipe
Nov 4, 2026
Merged

Brooooooklyn merged 1 commit into
mainfrom
fix/container-build-test-epipe

Conversation

@Brooooooklyn

Copy link
Copy Markdown
Member

Fixes a flaky unit run seen on #669: every test passed, but Vitest failed the job on an uncaught Error: write EPIPE from dockerBuild in @cloudflare/vite-plugin (test: "binds Container Durable Objects in the dev server…", added in #696).

dockerBuild: spawn(docker build … -f -) → child.stdin.write(Dockerfile)

old stub   #!/bin/sh
           exit 0                    → on a busy runner the stub exits before the write
                                       → write EPIPE, no error listener → uncaught → job fails
new stub   if [ "$1" = build ]; then cat >/dev/null; fi
           exit 0                    → the stub waits until stdin closes, so the write always lands

Reproduced locally by blocking the parent between spawn and write (same order as the CI trace):

stub result
old Error: write EPIPE
new ok

Only build reads stdin, so other Docker calls cannot block on it. Test-only change.

🤖 Generated with Claude Code

The Container dev server test stubs Docker with a script that exits
at once. The Cloudflare Vite plugin writes the Dockerfile to
`docker build -f -` on stdin, so when the stub exits before that
write, the write fails with an uncaught EPIPE and fails the test run.
The stub now reads stdin for `build`, so it cannot exit first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T04:44:20.673239Z a1b961d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://fix-container-build-test-epipe-void-cloud.voidzero-docs.workers.dev (commit a1b961d)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://9893df91-void-cloud.voidzero-docs.workers.dev a1b961d 2026-11-04T04:44:06.702Z Visit the dashboard ↗

@Brooooooklyn
Brooooooklyn merged commit 3c50c15 into main Nov 4, 2026
20 checks passed
@Brooooooklyn
Brooooooklyn deleted the fix/container-build-test-epipe branch November 4, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant