Skip to content

test: port June upstream test-hardening fixes (#729, #738) - #124

Merged
ajonkisz merged 2 commits into
aj-currentfrom
fable/d5-june-test-hardening
Jul 5, 2026
Merged

test: port June upstream test-hardening fixes (#729, #738)#124
ajonkisz merged 2 commits into
aj-currentfrom
fable/d5-june-test-hardening

Conversation

@ajonkisz

@ajonkisz ajonkisz commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

Post-program housekeeping: ports the LOW-RISK test-hardening subset of not-landed June 2026 upstream (G-Research/bobbit) PR content into this fork, per JUNE-PRS-REPORT.md "Residual risk" section. Each hunk was hand-verified against current code (files have diverged since June) rather than blindly applied.

Port / skip table

Item File Decision Rationale
G-Research#729 scrub-stability poll tests/e2e/ui/tree-cost-rollup.spec.ts Ported Hand-applied against current file (which already had an unrelated later hardening — an extra teardown-completion wait — spliced in between the two hunks). stableZeroPolls/getGeneration()/getGoalCost() all exist on the current CostTracker. Validated with 4/4 Playwright passes.
G-Research#738 synchronous PID reporting tests/verification-harness-timeout.test.ts Ported Genuine robustness fix, not a margin widening: the old payload piped the grandchild's stdout through the parent and waited for an async chunk before printing PARENT_PID; under full-suite load that round-trip could lose the race against a short timeout. New payload reports both PIDs synchronously right after spawn. Confirmed still-applicable — the racy async version was still present in this fork.
G-Research#738 poll-timeout widenings (×3, same file) tests/verification-harness-timeout.test.ts Skipped Pure margin-widening (3000/5000/3000 → 10_000ms) with no correctness change. Conflicts with this program's move from flaky-timing-margin fixes to by-construction proofs. One of the three is already superseded here by a strictly better fix (10000ms + explicit 100ms poll interval, with a comment on the Windows taskkill scheduling contention it accounts for).
G-Research#738 deadline widening tests/goal-push-safety-regression.test.ts Skipped Targets a waitForPublishedUpstream polling helper that no longer exists — this file has since been rewritten wholesale to synchronous by-construction assertions over git upstream-tracking config. Nothing left to widen.
G-Research#738 branch-existence race fix tests/worktree-pool.test.ts Skipped (already landed) The current file already captures the pooled branch name before claim() and asserts only that specific branch is gone (rather than the racy global-prefix-absence check) — equivalent logic already present, independently landed.

Out of scope (explicitly, per instructions)

G-Research#762 (multi-gateway, feature), G-Research#716 (Podman runtime, feature), G-Research#786 (prompt placeholders, separate lane), G-Research#715 (local config cleanup, touches gateway state), G-Research#724 (superseded), and G-Research#708/nurse-cap-equivalents — none touched.

Test plan

  • npm run check — passes clean.
  • npm run test:unit -- tests/verification-harness-timeout.test.ts tests/worktree-pool.test.ts tests/goal-push-safety-regression.test.ts — 28/28 pass.
  • npx playwright test -c playwright-e2e.config.ts tests/e2e/ui/tree-cost-rollup.spec.ts --retries=0 — 4/4 pass.

Upstream references (read-only, not pushed to): G-Research#729, G-Research#738

🤖 Generated with Claude Code

ajonkisz added 2 commits July 5, 2026 16:32
Hand-ports the scrub-stability poll from upstream G-Research/bobbit PR
G-Research#729 (unmerged upstream) against current tests/e2e/ui/tree-cost-rollup.spec.ts,
which has diverged since June:

- quiesceAutoStartedChildTeam's initial wait now polls for a populated
  `teamLeadSessionId` instead of just `getTeamState()` truthiness, so
  we don't race ahead of a team-lead session id being assigned.
- the goalId cost wipe after teardown becomes a stableZeroPolls loop
  keyed off CostTracker.getGeneration()/getGoalCost() (both present on
  the current CostTracker) instead of a single-shot removeSession
  sweep, to catch a final mock-agent usage event landing just after
  teardown returns.

Verified: `npm run check`, `npm run test:unit -- tests/e2e/ui/tree-cost-rollup.spec.ts`
would route to the browser/file:// suite so this was instead validated
directly with `npx playwright test -c playwright-e2e.config.ts
tests/e2e/ui/tree-cost-rollup.spec.ts --retries=0` — all 4 tests pass.

Upstream: G-Research#729
Hand-ports the genuine-robustness hunk from upstream G-Research/bobbit
PR G-Research#738 (unmerged upstream, "harden unit flakes under full-suite load")
against current tests/verification-harness-timeout.test.ts.

TREE_PAYLOAD no longer pipes the grandchild's stdout through the parent
and waits for an async stdout chunk before printing PARENT_PID — under
full-suite load on slow Windows workers that round-trip could lose the
race against a short timeout, failing the test before it captured both
PIDs. The parent now reports PARENT_PID and CHILD_PID synchronously,
immediately after spawn (`child.pid` is available as soon as the OS
child exists) — removing the race entirely rather than widening a
margin around it.

Skipped from the same upstream PR (see PR body for the full table):
- The three `poll(..., <n>ms)` timeout-widenings in this same file
  (3000/5000/3000 -> 10_000) are pure margin-widening with no
  correctness change; our program has since moved flaky timing tests
  toward by-construction proofs rather than bigger margins, so these
  were left alone. One of the three (the cancellation-test reap poll)
  is already superseded here by an even better fix already in this
  file (10000ms + explicit 100ms poll interval, with a comment
  explaining the Windows taskkill scheduling contention it accounts
  for).
- tests/goal-push-safety-regression.test.ts: the PR's `10_000ms ->
  60_000ms` deadline widening targets a `waitForPublishedUpstream`
  helper/function that no longer exists in this fork — that test file
  has since been rewritten wholesale to synchronous by-construction
  assertions over git upstream-tracking config, with no polling loop
  left to widen.
- tests/worktree-pool.test.ts: the PR's fix for the racy
  `pool/_pool-*` branch-existence assertion (capture the pooled branch
  name before claim, assert only that branch is gone rather than the
  prefix's global absence) is already present in this fork,
  independently landed with equivalent logic.

Verified: `npm run check` and `npm run test:unit -- tests/verification-harness-timeout.test.ts
tests/worktree-pool.test.ts tests/goal-push-safety-regression.test.ts`
— 28/28 pass.

Upstream: G-Research#738
@ajonkisz
ajonkisz merged commit d1db4d3 into aj-current Jul 5, 2026
@ajonkisz
ajonkisz deleted the fable/d5-june-test-hardening branch July 5, 2026 15:46
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