Skip to content

Free test shards stop failing when a test's browser exits during the cleanup check (GST-3447) - #4666

Merged
capy-ai[bot] merged 1 commit into
mainfrom
free-tests-browser-exit-during-identity-check
Nov 22, 2026
Merged

capy-ai[bot] merged 1 commit into
mainfrom
free-tests-browser-exit-during-identity-check

Conversation

@garrytan

@garrytan garrytan commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Free test shards no longer fail with "native process identity unavailable" when a browser a test started exits while the runner is checking it, and the Free Tests planning job gets 10 minutes instead of 5.
Why: these were the two causes left of main's flapping Free Tests runs; the other four flaps from 11-18 and 11-19 were fixed earlier by #4490 and #4530.
Nothing to do.

What changed

Free test shards were failing with no failing test: "shard 8/8 shard cleanup or home containment failed: native process identity unavailable" (quick-bun-default, run 44850005025 at 41729a0). The shard's browser cleanup tracker checks each browser process it owns by reading its start time with ps -o lstart=. When that browser exited on its own during the check, the tracker counted it as an ownership failure and failed the whole shard.

Now a process that is provably gone just ends that round of checking, and the next round sees it gone. A failed check of a process that is still alive, a process whose identity was replaced, and every ownership mismatch still fail the shard, and a real error is reported ahead of an exit seen in the same round. A new test mode, identity-probe-exit, uses a stand-in ps that kills the recorded Chromium child during its first check; it fails before the fix with the exact CI message and passes after.

The Free Tests planning job (free-plan) now has 10 minutes instead of 5: its "Set up job" step alone ran 5m18s on run 44980222821 and the job was cancelled, while the job normally takes 13 to 26 seconds.

Why

"Free Tests on main keeps going red with no failing test." These two causes were the last ones behind main's flapping Free Tests runs, so after this a red Free Tests run should point at a real test failure.

Blast radius

The change touches only the free test runner's browser cleanup tracker (scripts/test-free-shards.ts), its test helper and one workflow timeout. The tracker still reports every live-process, replaced-identity and ownership failure: the replaced-pid, replaced-start, stale-child-start and unavailable-environment settlement modes were rerun on this head and pass (script ran), and CI's full free suite passed at this head (run 44993690417).

Pre-Landing Review

No blocking issues. The review panel (batched specialist, red team, targeted gate reader, a second-model review on GPT-6.1 Sol and an adversarial reader) found nothing that blocks. The one gate change, the planning job's longer timeout, was reviewed and kept by the owner with the measurement above.

Review notes

Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.

  • INFORMATIONAL scripts/test-free-shards.ts:1419 error-handling
  • INFORMATIONAL scripts/test-free-shards.ts:1345 observability
  • INFORMATIONAL test/helpers/free-owned-browser-settlement.ts:167 test-isolation
  • INFORMATIONAL test/test-free-shards-settlement-lifecycle.test.ts:1 flaky-test
Exploratory QA

Pass. Capture 001: identity-probe-exit passes (1 pass, 0 fail). Capture 002: unavailable-environment, replaced-pid, replaced-start, stale-child-start, cancel-cold-probes and settle-cold-probes pass (6 pass, 0 fail). The probe stand-in modes are Linux-only, so macOS and Windows coverage comes from CI.

Eval Results

No prompt-related files changed — evals skipped.

TODOS

No TODO items completed in this PR.

Documentation

Scope: branch free-tests-browser-exit-during-identity-check against base 6484fd5. It changes the Free Tests workflow (free-plan timeout raised from 5 to 10 minutes), the shard browser cleanup tracker in scripts/test-free-shards.ts (a browser that exits during its identity check now ends the check instead of failing the shard), its test helper, and one changelog.d fragment.

Result: current. I searched README, CONTRIBUTING, docs/ and skill Markdown. docs/TESTING_INTERNALS.md and docs/pregate.md name the free-plan job and artifact but describe neither its timeout nor the tracker's identity-check behavior, so nothing became stale. The changelog fragment matches the code change.

Debt: none found. The tracker's identity-check rules are documented only in code and in the changelog fragment.

Tests
  • Free Tests (CI, workflow_dispatch run 44993690417 at a052564): green, 1740 test files carried, macOS and Windows launcher jobs green
  • Windows Smoke (run 44984379987 at a052564): green
  • bun test test/test-free-shards-settlement-lifecycle.test.ts -t identity-probe-exit: 1 pass, 0 fail
  • bun test ownership and cold-probe settlement modes: 6 pass, 0 fail
Agent notes

Agent notes

Flaky pass GST-3447 (lane GSTA-793). Per-failure table and evidence: captain drive reports/GSTA-793.md. The AskUserQuestion format eval reds are diagnosed there and are not changed by this PR.

REVIEW_LOOP: passes=1 blocking_found=1 deferred=0 noted=4 fixed=0 scope=frozen

Gate edits: 1 listed, 1 read, 1 finding — 1 kept, 0 restored, 0 open

  • RH-15 .github/workflows/free-tests.yml: owner disposition a-4b9ce38e65cf: free-plan timeout-minutes 5 -> 10 after a measured 5m18s Set up job cancellation (run 44980222821)

Gate disposition: .github/workflows/free-tests.yml:221:gate-integrity [gate 984b34e93302] at a052564 by GStack Minder (GSTA-36) at 2026-11-22T06:21:50.617Z: free-plan timeout-minutes 5 -> 10: Set up job alone ran 5m18s and was cancelled on run 44980222821; the job normally takes 13-26 s — "Fix that too if it's a one-line timeout change." (approval a-4b9ce38e65cf)

Second-model review: openai/gpt-6.1-sol, completed, clean.

Approvals

Approved: yes (record r-4a0ce06aab6c). The full approval record stays private.
Plan: exempt: bug fix (R65; failing-first test identity-probe-exit)
Plan check: exempt bug fix

{
  "schema_version": 1,
  "pr": 4666,
  "head": "a052564fa2565edf08ec653b69d176a1b0e31c38",
  "version": "1.102.2.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 1740,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 44993690417,
      "attempt": 1,
      "tree": "a8612b18128dac6d8fe637c4bfb02fe937903de7"
    }
  ],
  "calls": 56,
  "session_kind": "unattended",
  "run": "ship-4666",
  "head_tree": "a8612b18128dac6d8fe637c4bfb02fe937903de7",
  "product_patch_id": "8e482bdd0a5b54f618431b926d57e6eb04e0d8b9",
  "gstack_version": "1.102.2.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 13,
    "rules": "630fd3101899e28e",
    "base": "6963fa8089afbce2a36a4839b2b8986f2e4b2f81",
    "registry": "6963fa8089afbce2a36a4839b2b8986f2e4b2f81",
    "gate_scan": {
      "tagged": 1,
      "head": "a052564fa2565edf08ec653b69d176a1b0e31c38"
    },
    "reasons": [
      "gate-class",
      "runtime=13"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @a8612b18128d (8 checks, current for a052564fa256)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/44993690417/attempts/1",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44993690417/attempts/1",
    "free-tests.yml/cso-windows-launcher: https://github.com/garrytan/gstack/actions/runs/44993690417/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/44984379987/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=a8612b18128d tests=38786 skipped=67 runs=44993690417/1 profiles=ci-reuse/free-tests heads=a052564fa256 verified=2026-11-22T06:42:55.795Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "README.md, CONTRIBUTING.md, CLAUDE.md, AGENTS.md and docs/ (155 files)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 1,
    "deferred": 0,
    "noted": 4,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "ledgers_read": 3
  },
  "gate_dispositions": [
    {
      "finding": ".github/workflows/free-tests.yml:221:gate-integrity",
      "gate_id": "984b34e93302",
      "head": "a052564fa2565edf08ec653b69d176a1b0e31c38",
      "by": "GStack Minder (GSTA-36)",
      "reason": "free-plan timeout-minutes 5 -> 10: Set up job alone ran 5m18s and was cancelled on run 44980222821; the job normally takes 13-26 s",
      "words": "Fix that too if it's a one-line timeout change.",
      "at": "2026-11-22T06:21:50.617Z",
      "approval": "a-4b9ce38e65cf"
    }
  ],
  "review_targeted": {
    "classes": [
      "gate"
    ],
    "rules": "b3f6f8b4843c0c30",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "8e482bdd0a5b54f618431b926d57e6eb04e0d8b9",
    "status": "done",
    "findings": 0,
    "raised_by": "targeted"
  }
}
{"head":"a052564fa2565edf08ec653b69d176a1b0e31c38","run":"ship-4666","mark":"stop","tree":"a8612b18128dac6d8fe637c4bfb02fe937903de7"}

Open in Capy

…cleanup check (GST-3447)

Free test shards no longer fail with "native process identity unavailable" when a browser a test started exits while the runner is checking it, and the Free Tests planning job gets 10 minutes instead of 5.
Why: these were the two causes left of main's flapping Free Tests runs.
Nothing to do.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@capy-ai
capy-ai Bot merged commit 3c9cda0 into main Nov 22, 2026
78 checks passed
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