Repository navigation
tests: two CI flakes: the security check's over-cap close race, and check-release-paths run before its install finishes - #3349
Merged
Merged
Conversation
…ap body, and proves the cap without a race "GET body of 65537 bytes against the unread cap" failed on a hosted runner with "[Errno 107] Transport endpoint is not connected". The server refuses that request on its declared length (http_body.zig:79) and closes without reading the body, so the unread bytes reset the connection; on a busy runner the reset can reach the client while it is still sending or shutting down its side, before it reads the 400. - exchange() can treat a reset, a closed pipe or a no-longer-connected socket as the server closing first. Only the over-cap case asks for that; every other case still fails on it. - When the server closed first, whatever arrived must not be a 2xx reply, and a complete reply must be the expected 400. - A new case sends only the head declaring 65,537 bytes. Nothing is left unread, so the server closes cleanly and its 400 always arrives: the cap is proved on every run, with no race.
…o a run never executes a file mid-write A hosted runner failed with "failed to spawn and capture stdio from ./zig-out/bin/check-release-paths: FileBusy" (ETXTBSY). Zig 0.17's run step executes an artifact's installed copy whenever the same build installs it (lib/compiler/Maker/Step/Run.zig:388, `installed_path orelse` the cache path), without waiting for the install. compile-release-paths-host installed the same checker that the release directory and command tests run, so a build doing both, such as test-host, could start a run while the install was still writing zig-out/bin/check-release-paths. compile-release-paths-host now installs a compile of its own; the tests' checker is never installed, so every run starts the finished file in the cache. Both compiles share one cache entry, so nothing builds twice. Traced with strace in one build of compile-release-paths-host, test-release-directory-host and test-release-paths-command-host: on main 17 of 18 runs executed ./zig-out/bin/check-release-paths; now all 18 run from the cache.
ashhart
force-pushed
the
lead/ci-flakes-2
branch
from
November 14, 2026 17:03
6e09788 to
933c4f3
Compare
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.
tests and build: two CI flakes, an over-cap body racing the server's close and a checker run racing its install
Two failures on hosted runners today. Neither was a product bug. Each commit fixes one.
1. The server security check: "Transport endpoint is not connected"
"GET body of 65537 bytes against the unread cap" failed with
[Errno 107] Transport endpoint is not connected.Why:
Content-Length(zig/src/server/http_body.zig:79) and closes withoutreading the body.
What changes (
zig/tests/server/security_check.py):exchange()can treat a reset, a closed pipe or a no-longer-connected socket as the server closing first. Only theover-cap case asks for that; every other case still fails on such an error, as before.
When the server closed first, nothing that arrived may be a 2xx reply, and a complete reply must be the expected 400.
A new case proves the cap with no race. It sends only the head declaring 65,537 bytes. Nothing is left unread, so
the server closes cleanly and its 400 always arrives.
This case matters because after a reset the kernel drops any reply not yet read. A reset alone can't show that the
request wasn't served; this case can.
Checks:
zig build -Dfixed-cpu test-server-security: 28 passed, 0 failed (27 before, plus the new case).exchangeagainst a local server that resets after the head: the close-first path accepts it, and thestrict path still raises.
2.
check-release-paths: FileBusy"failed to spawn and capture stdio from ./zig-out/bin/check-release-paths: FileBusy" (ETXTBSY).
Why:
(
lib/compiler/Maker/Step/Run.zig:388:installed_path orelsethe cache path). It doesn't wait for the install.compile-release-paths-hostinstalled the same checker that the release directory and command tests run.test-host, could start a run while the install was still writing the file.What changes (
zig/build/cuda_release_paths.zig):compile-release-paths-hostinstalls a compile of its own. Thetests' checker is never installed, so every run starts the finished file in the cache. Both compiles share one cache
entry, so nothing builds twice, and
zig-out/bin/check-release-pathsis still installed as before.Traced with strace in one build of
compile-release-paths-host,test-release-directory-hostandtest-release-paths-command-host:./zig-out/bin/check-release-pathsChecks:
test-check-release-paths,test-release-paths-host,test-release-directory-host,test-release-paths-command-hostandcompile-release-paths-hostpass with-Dfixed-cpu.Both
No change to the server or the checker itself.
zig fmt --checkis clean, and lean is 341, the same as main.🤖 Generated with Claude Code