Skip to content

test(ci): release the escaped cleanup descendant and add two browser duration rows - #2954

Merged
freeqaz merged 1 commit into
mainfrom
test-timing-1019
Oct 19, 2026
Merged

freeqaz merged 1 commit into
mainfrom
test-timing-1019

Conversation

@freeqaz

@freeqaz freeqaz commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

Problem

The 10-19 CI flake sweep flagged two timing gaps in the test suites:

  • ci-cleanup escaped-group: the whole test reached 5.34 s against the 6 s timeout in its block (89%), unchanged across sweeps, on runners still 1.2-1.5x slow. That 6 s bounds only the spawnSync cleanup driver, which takes about 0.8 s (tree ready about 100 ms, cleanup done about 710 ms after its deadline starts). The other ~3.3 s was a fixed wait: cleanup must leave the escaped descendant running, so the fixture teardown waited out the descendant's own 4 s lifetime before it could observe it gone.
  • file-durations.json: console-namespace-recheck (new in fix(console): the Namespace recheck survives a failed read and stops on terminal states #2944) has no row, so it starts first in its lane; console-status-block's row is 12.2 s while its CI median is 25.9 s raw (about 21 s normalised). test(console): consolidate the console browser tests added since #2903 #2947 set that row by scaling with a local before/after ratio (0.687) that did not hold on CI.

Change

  • tests/integration/ci-cleanup.test.mjs: the descendant also exits when a release file exists (checked in its existing 50 ms heartbeat). The escaped-group case writes that file only after ps has observed the descendant alive, so teardown sees it end within one tick instead of waiting 4 s. The 4 s lifetime stays as the bound for a failed run, and the 6 s driver limit is unchanged (it bounds a ~0.8 s step). The other four scenarios are unchanged: their descendant dies with the owned group before the driver exits.
  • scripts/ci/test-suites/file-durations.json: console-status-block 12200 -> 20900; new console-namespace-recheck 11900; the source note says how. Method (the sweep's): per main run and lane, factor = median(file wall / row) over the lane's passed files that have a row; a file's normalised time = its wall / factor; the row = median over the main runs since the file last changed.

Watched, no change: QA provider-delivery worst 1,746 s of 2,400 s (73%) and QA shipped startup 678 s of 1,100 s (62%).

Verification

  • escaped-group locally at 2 CPUs: 4.11 s / 4.12 s before, 0.87 s after; cleanup still completes 709 ms after its deadline starts.
  • Mutants on the escaped-group case (each reverted):
    • descendant left in the owned group (detached: false, the same as cleanup killing it): fails "escaped descendant stopped during cleanup".
    • cleanup waits for the escaped descendant (no SIGKILL escalation and no pipe abandon in scripts/ci/cleanup.mjs): fails "cleanup exceeded the command and pipe deadlines" at 4011 ms, so the release cannot shorten a hang.
  • tests/integration/ci-cleanup.test.mjs full file 20/20 at 2 CPUs (CPUs 2-3): 30/30 tests each run, escaped-group 861-885 ms, file 16.0-16.4 s.
  • node scripts/ci/run-tests.mjs audit: no issues.
  • No open PR touches either file (checked 85 open PRs), so no new conflicts.

Risks

Test and CI-scheduling data only. The release file is written after the liveness check, so it cannot hide a cleanup that killed or waited on the descendant. The rows only change start order in the browser lanes. ci-cleanup's own row (23.2 s) will be about 3 s high until the next refresh; left as is rather than set from a local estimate.

…duration rows

The escaped-group cleanup case waited out its descendant's 4 s lifetime in
teardown; release it once ps has observed it alive (4.1 s -> 0.9 s locally).
Add console-namespace-recheck's row and re-measure console-status-block's with
the sweep's slowdown-normalised median.
@freeqaz
freeqaz requested a review from a team as a code owner October 19, 2026 18:36
@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR releases a test descendant after observing it alive and refreshes two browser-test scheduling estimates.

Example: A contributor runs the escaped-group cleanup integration case.

  • Before: Teardown waits for the descendant’s four-second lifetime; the PR reports approximately 4.1 seconds overall.
  • After: The test requests exit after its liveness observation; the PR reports approximately 0.9 seconds overall.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-consistent; validation consists of reported harness runs and mutation checks rather than independently inspected execution output.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test maintenance is outside the ordinary contributor proof gate; the body reports repeated real-process fixture runs and two rejecting mutants, while inspected screenshots belong to the earlier Namespace UI change and provide no evidence for this patch.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Contributors incur an unnecessary fixture teardown delay and browser lanes use missing or stale scheduling estimates.
Reason: The maintainer-authored direction has concrete CI value and stays within existing test and scheduling owners.

Merge readiness

✅ Ready for maintainer review

Keep this PR open for maintainer triage; the focused test optimization preserves the cleanup assertions, and no actionable defect was found.

Priority: P3
Reviewed head: fd991d30ac577c058f261aaa1fc158924ca7c302

Before merge

None.

Findings

None.

Agent review details

How this fits together

The CI runner consumes measured file durations to order shared test files, while the cleanup integration fixture exercises real subprocess ownership and inherited-pipe deadlines.

flowchart TD
  A[Duration table] --> B[CI runner]
  B --> C[Ordered test files]
  C --> D[Cleanup integration fixture]
  D --> E[Cleanup executor]
  E --> F[Command process group]
  D --> G[Escaped descendant observation and release]
Loading

Technical review

Best possible solution:

Retain the fixture release after observation and the measured scheduling updates while preserving all existing cleanup deadlines and ownership checks.

Do we have a high-confidence way to reproduce the issue?

The base fixture leaves the escaped descendant alive and teardown waits for its four-second expiry; source establishes the unnecessary wait, while timing measurements remain contributor-reported.

Is this the best way to solve the issue?

The change addresses the unnecessary wait through the existing fixture heartbeat without weakening the assertions that cleanup returns promptly and leaves the escaped process alive.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against d331d24fdddc.

Provenance checked

  • Cleanup descendant fixture keeps the original intent (3ade362: Bound inherited pipes while retaining process-group ownership; the later readiness repair starts the short deadline only after the command tree is ready.)
  • Browser duration estimates changes intended behavior with a stated reason (22283f6: Refresh scheduling measurements after browser-test consolidation; this PR explains that the local scaling ratio did not match subsequent CI measurements.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Free Wortley: Raw commit 3ade362 adds tests/integration/ci-cleanup.test.mjs:419 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3ade362535be; files: tests/integration/ci-cleanup.test.mjs)

Review metrics

Metric Value Why it matters
Change scope Fixture +11/-1 lines; scheduling data +3/-2 lines The small increase reuses the existing heartbeat and adds no production cleanup machinery or new tests.

Labels

Label changes:

  • add P3: This is focused test maintenance and CI scheduling improvement with no product runtime change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is focused test maintenance and CI scheduling improvement with no product runtime change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 19, 2026, 2:48 PM ET / 18:48 UTC.

@freeqaz
freeqaz merged commit 49767aa into main Oct 19, 2026
78 checks passed
@freeqaz
freeqaz deleted the test-timing-1019 branch October 19, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant