Repository navigation
v1.91.250.0 fix(tests): remove three free-tier fixture races (GSTA-107 daily flaky pass) - #3474
Merged
Merged
Conversation
… in dotenv-isolation and claude-code-runner, per-fixture Git repo in cso-git-hardening (GSTA-107) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
The new dotenv-isolation test spawns Bun with emptyBunConfig() instead of a literal --config=/dev/null, which the Windows lane cannot open; the runner's timeout case asserts the descendant published a pid before asking whether it is running, so a missed readiness window names itself. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
seedRepo commits with fixtureGit's replacement env, which never sees the shard backstop, so each commit started a detached git maintenance run that creates and deletes .git/objects/maintenance.lock under the tests' own .git reads and the afterEach rmSync (docs/TESTING_INTERNALS.md, Free-suite flake rules). Found by /ship's documentation audit; git 2.55.0 trace2 shows the maintenance spawn with the keys unset and none with them set. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… base=origin/main@3ab7b14 policy=base origin/main@3ab7b149c908:.gstack/ship-policy.json) STAMP_VERSION: 1.91.250.0 stage version: done (wrote 1.91.250.0) stage release_tool: done (bun scripts/gen-agents-digest.ts) stage changelog: done (Unreleased -> 1.91.250.0) stage stamp_paths: skipped (no stamp_paths in policy) stage mirror: skipped (no mirror in policy) stage apply: done (4 file(s)) FILES: CHANGELOG.md VERSION agents-digest/gstack-AGENTS.md package.json GSTACK_RESULT: skill=restamp status=complete run=/workspace/gstack/.gstack/tmp/restamp-journal.json Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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 changed
The probe publishes its result by rename and waitForFile waits for content, not existence, so a 50 ms poll can no longer read an empty agent-env.json (Free Tests shard 2, twice)
Before/after as text: The probe publishes its result by rename and waitForFile waits for content, not existence, so a 50 ms poll can no longer read an empty agent-env.json (Free Tests shard 2, twice)
Each fixture builds its own Git repository with auto-maintenance off instead of copying a shared template with fs.cpSync, so no directory walk races a detached git maintenance run (Free Tests shard 17)
Before/after as text: Each fixture builds its own Git repository with auto-maintenance off instead of copying a shared template with fs.cpSync, so no directory walk races a detached git maintenance run (Free Tests shard 17)
The descendant publishes its pid by rename and the timeout case polls publishedPid(), a positive integer, so an empty read no longer becomes pid 0 (Free Tests shard 13)
Before/after as text: The descendant publishes its pid by rename and the timeout case polls publishedPid(), a positive integer, so an empty read no longer becomes pid 0 (Free Tests shard 13)
Three free-tier files that failed once in Free Tests and passed on the serial retry each had a self-inflicted race, repaired in the fixture; no assertion, timeout or budget changed.
browse/test/dotenv-isolation.test.tsagent-env.jsonread)waitForFilereturned as soon as the file existed; the probe created it with a plainwriteFileSync, so a 50 ms poll between create and write read""waitForFilewaits for content. The new test spawns Bun withemptyBunConfig()so it also runs on the Windows lane (/ship review fix)test/claude-code-runner.test.tsrunning(pid)false at the timeout case)descendant.pidthenNumber(readFileSync(...)), so an empty read became pid 0 and/proc/0/statdoes not existpublishedPid()(a positive integer) and asserts it was published before asking whether it runs (/ship review fix)test/cso-git-hardening.test.tsfs.cpSyncthrew insidecopyDir/getStatsSyncinfixture(), empty error message, passed on retry)fs.cpSync; the walk failed once on a stat inside it. /ship's docs audit found the likely file:git commitstarts a detachedgit maintenance run --autothat creates and deletes.git/objects/maintenance.lockafter the commit returns, andfixtureGit's replacement env never saw the shard backstop (docs/TESTING_INTERNALS.md, Free-suite flake rules)maintenance.auto=falseandgc.auto=0;beforeAllstill pays the cold macOS Git spawns once on a throwaway repositoryWhy
The GSTA-107 daily flaky pass found three free-tier files that each failed once in Free Tests (runs 39902683183, 40322888041, 39694715116, 40288142343) and passed on the serial retry. Each failure came from the fixture racing itself, not from the code under test, so the repairs stay inside the fixtures: nothing a user runs changes, and the free suite stops paying a serial retry for these files. The CHANGELOG entry stays under
## [Unreleased](stamp-at-merge).Approvals
Source: gstack-approvals record for capy/gsta-107-free-fixtures (display only; not an approval citation).
Summary
Fixture-only repairs for three free-tier races (atomic result files in dotenv-isolation and claude-code-runner, per-fixture Git repositories with auto-maintenance off in cso-git-hardening), plus two /ship review fixes in the same files (Windows-safe Bun config in the new dotenv test; the runner names a missed pid publication). No product code changed.
Test Coverage
Test-only diff: the coverage audit returned a skipped audit (null coverage, zero gaps, "No new application code paths to audit"). Coverage gate: could not determine percentage — skipping.
Tests: 367 → 367 test files (+0 new files; one new test case in
browse/test/dotenv-isolation.test.tsfeeds the old race and fails on the pre-fix poller with the CI message, see Exploratory QA capture 004).Tests ran: free (Ubicloud remote pregate,
gstack-pregate --stage all --remote --spend-cap 2 --timeout 2700 --allow-repo-commands --base main) 9236 (0 failed, tree 31f7ad6f291e).Tests ran: focused local
bun testof the three changed files 4 + 21 + 11 (0 failed), plustest/bun-entry-isolation.test.tsandtest/spawnsync-timeout-tripwire.test.ts13 (0 failed);bun run typecheck0 errors;bun run typecheck:test819 known, none new.Pre-Landing Review
Review loop: 3 passes (CREW rule 23 cap; pass 1 whole diff, passes 2 and 3 delta only; pass 3 found nothing new).
Pass 1 (whole diff; 3 specialists: testing, maintainability, performance; security, data-migration, api-contract, design, simplification and state-machines skipped by scope; Red Team not activated, 76 lines, no CRITICAL): 9 informational findings, 0 critical. Fixed in 4dcd7f3:
browse/test/dotenv-isolation.test.ts:63— the new test spawned Bun with a literal--config=/dev/null; the file runs on the Windows lane, where native Bun cannot open it. Now--config=${emptyBunConfig()}frombrowse/src/bun-child-config.test/claude-code-runner.test.ts:309—running(publishedPid()!)failed as "expected true, got false" when the readiness window expired; the pid is now captured once and asserted defined with a message.Pass 2 (delta 4dcd7f3): no new findings. The documentation audit then found
seedRepocommitting withoutmaintenance.auto=false/gc.auto=0(docs/TESTING_INTERNALS.md, Free-suite flake rules); fixed in 895219f, git 2.55.0 trace2 shows the detached maintenance spawn with the keys unset and none with them set.Pass 3 (delta 895219f): no new findings.
Named and left as they are (advisory, informational or test-gap items per CREW rule 23):
browse/test/dotenv-isolation.test.ts:66(testing 6, adversarial 8): the new test's second half proves valid JSON and no leftover.tmp, not rename atomicity itself; the first half (empty file filled 150 ms later) is what guards the race.test/cso-git-hardening.test.ts:28(performance 5, testing 5, adversarial 5, multi-specialist confirmed):fixture()now costs seven Git spawns per test instead of onecpSync; measured 41-216 ms per test on a 4-core Linux box; the macOS lane measures the cold case.browse/test/dotenv-isolation.test.ts:28[ADVISORY] (maintainability 5): the write-temp-then-rename idiom is now hand-written in three fixtures; a shared test helper is a proposal, not a defect.browse/test/dotenv-isolation.test.ts:56(maintainability 5): one test covers both the poller and the probe; the 150 ms timer is not cleared.browse/test/dotenv-isolation.test.ts:38,test/cso-git-hardening.test.ts:13(maintainability 4, appendix): barecatch {}inwaitForFile; comments cite CI run ids.Deferred to #3476 (pre-existing or neighbouring code):
fixtureGittreats a null spawn status as success (test/cso-git-hardening.test.ts:12); other browse tests still spawn Bun with a literal--config=/dev/null.Gate edits: none detected (9 listed, 6 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none). The six read hunks remove lines only to replace an existence poll with a content wait, a plain write with a rename, and a template copy with a per-fixture repository; no assertion, timeout, retry or skip was loosened. Forced probe for the test-only flake fix: the pre-fix poller fed the same empty-then-filled file fails with
SyntaxError: JSON Parse error: Unexpected EOF(capture 004); the fixed files passed 20/20 under 24 busy loops on 4 cores before this run and 9236/0 on the remote free tier at the final tree.Outside review: unavailable (Codex CLI not installed on this machine;
codex_reviewsunset). Native adversarial passes: Claude (anthropic/claude-sonnet-5-5, high reasoning) on passes 1, 2 and 3; specialists on anthropic/claude-sonnet-5-5. Missing outside coverage is listed, not passed.Exploratory QA
Functional surface only (bun:test CLI runs), 5-minute smoke budget, report at
.gstack/qa-reports/ship-3474-20261026T143047Z/functional/functional-report.mdon the ship machine. Captures: 001 dotenv 4/4 pass (pre-fix tree, superseded by 005), 002 runner 21/21 (superseded by 006), 003 cso-git-hardening 11/11 with per-test 41-216 ms, 004 forced probe: the pre-fixwaitForFileexits 1 with the CI message, 005 dotenv 4/4 and 006 runner 21/21 after the review fixes. Verdict: pass; no reproduced defect. Limits: Windows and macOS lanes not run locally (covered by the dispatched free-tests.yml and windows-free-tests.yml runs).Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related files changed — evals skipped (
bun run scripts/eval-select.ts --base origin/main: behavioral probes none, quality judges none; aside-browse-basic, aside-browse-flow and carve-section-loading-browse remain scheduled/release coverage). Paid eval spend: $0.Greptile Review
No Greptile comments (no Greptile signal on this repository; the PR has no comments or reviews from a Greptile account).
Scope Drift
Scope Check: CLEAN
Intent: remove three free-tier fixture races found by the GSTA-107 daily flaky pass without changing assertions, timeouts or budgets.
Delivered: fixture-only changes in the three named test files, the CHANGELOG entry, and two review fixes inside the same files.
Plan Completion
Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Fix: add "Plan: " to the PR body, or run /autoplan.
Acceptance edits: baseline unavailable (no plan file).
Verification Results
No plan-specific verification items (no plan file). Automatic diff-scoped QA: 6 captures, 6 PASS (2 superseded and rerun), 0 FAIL, 0 BLOCKED, 0 NOT RUN.
TODOS
No TODO items completed in this PR.
Documentation
Status: current. No documentation edits were needed or made (audit ship-3474-docs2-20261026T144023Z, the second and last attempt of this /ship invocation; the first, ship-3474-docs-20261026T143542Z, was also current and surfaced the auto-maintenance finding fixed in 895219f).
Scope: the base-to-HEAD diff (ab9a854..895219f: CHANGELOG.md plus three test files), with no staged, unstaged or untracked content. It includes 4dcd7f3 (the new dotenv test spawns Bun with
emptyBunConfig(), and the runner asserts the pid was published) and 895219f (cso-git-hardeningseedReposetsmaintenance.auto=falseandgc.auto=0). Banned-terms check: none (the repo keeps no list). Discovery covered 123 candidate docs. Files read: the changed docs and tests, the test-policy docs, the entry-point docs, andinvestigate/sections/flake.md.tmpl. Other docs were checked with grep for references to the changed tests, the template-repo copy,cpSync, auto-maintenance, and the atomic-publish or poll patterns.Documentation health:
CHANGELOG.md Current ([Unreleased] entry matches the final diff, including the maintenance.auto=false / gc.auto=0 wording; protected, not edited)
docs/TESTING_INTERNALS.md Current (the Free-suite flake rules already require fixtures that commit then list, watch or remove .git to turn auto-maintenance off, with the same two keys; the new seedRepo conforms, so the earlier finding is resolved. No mention of the removed shared-template copy)
docs/TEST_PORTFOLIO.md Current (no reference to the three tests)
docs/test-audit-2026-10.md Current (dated record; its "fix wave 2" flake-rate row is a historical measurement and is left alone)
docs/test-value-bar.md Current
docs/triage.md Current
CONTRIBUTING.md Current (test-tier and flake-ledger text unaffected)
AGENTS.md Current (validation discipline unchanged; the diff changes no commands or conventions)
CLAUDE.md Current
README.md Current
VERSION Current (1.91.246.0; the CHANGELOG [Unreleased] heading sits above it by design under stamp-at-merge; protected, not edited)
Documentation coverage:
Entity: atomic publish and content-wait polling for fixture result files (dotenv-isolation probe, claude-code-runner pid)
reference: no, how-to: no, tutorial: no, explanation: partial (CHANGELOG entry only)
Entity: per-fixture Git repositories with auto-maintenance off in cso-git-hardening
reference: yes (TESTING_INTERNALS Free-suite flake rules), how-to: no, tutorial: no, explanation: yes (the rule's own rationale)
Documentation debt:
Diagram drift: none. The diff touches no component named in an ARCHITECTURE diagram, and no doc diagram names these fixtures.
Test plan
gstack-pregate --stage all --remote --spend-cap 2 --timeout 2700 --allow-repo-commands --base main(Ubicloud, one VM): 9236 tests, 0 failed, tree 31f7ad6f291e, $0.05 (a first run on the pre-fix tree dcff4de0b4a2 also passed 9236/0, $0.06, and was not certified because the tree changed under it)bun test browse/test/dotenv-isolation.test.ts test/claude-code-runner.test.ts test/cso-git-hardening.test.ts: 4 + 21 + 11 pass, 0 failbun test test/bun-entry-isolation.test.ts test/spawnsync-timeout-tripwire.test.ts: 13 pass, 0 failbun run typecheck: 0 errors;bun run typecheck:test: 819 known diagnostics, none new🤖 Generated with Claude Code via gstack /ship under Capy