Skip to content

test(walk): separate cancellation fixture setup from test timing - #406

Merged
steipete merged 1 commit into
mainfrom
codex/pass2-walk-fixture-20260915
Sep 15, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/pass2-walk-fixture-20260915

Conversation

@steipete

@steipete steipete commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

The budgeted-walk cancellation test prepared 256 files inside the same five-second deadline used to check cancellation. A Windows Node 24 run timed out, although its log does not establish whether fixture setup or the scan consumed the deadline.

Move that fixture preparation and Root construction into the existing suite fixture helper, with its 30-second setup lifetime. The suite owns the temporary directory and waits for every write to settle before propagating setup errors or removing it. The cancellation test retains its original five-second timeout and unchanged assertions. An opt-in proof delays the real fixture writes for six seconds without changing normal CI timing.

Validation:

  • pnpm test test/root-walk-budget.test.ts test/suite-fixture.test.ts: 28 passed on Node 24.
  • FS_SAFE_NATIVE=off pnpm test --config scripts/slow-walk-fixture.config.ts --disableConsoleIntercept: cancellation passed after 6.03 seconds of fixture setup; all 256 writes completed, one directory removal, no teardown race.
  • Repository file-size and filesystem-boundary lints, plus git diff --check, passed.
  • Full pnpm check passed on Node 24: 6,770 tests passed, 2,846 skipped, followed by package validation. The first attempt timed out in the unchanged ClawSweeper dispatch fixture; its four-test isolated run and the repeated full check passed without code changes.
  • Independent branch review found no actionable P0–P2 issues.

@steipete
steipete requested a review from a team as a code owner September 15, 2026 10:36
@clawsweeper

clawsweeper Bot commented Sep 15, 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 P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 15, 2026, 6:40 AM ET / 10:40 UTC.

ClawSweeper review

What this changes

Move cancellation-test fixture preparation into the existing suite lifecycle helper and add an opt-in slow-filesystem validation harness.

Merge readiness

✅ Ready for maintainer review

The change remains useful: both pinned main and v0.11.0 still prepare the fixture inside the cancellation test. No actionable correctness or security defect was found.

Priority: P3
Reviewed head: 180a3b889abced35ef33f93dbe033e0df4c26750

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation reuses established lifecycle handling and supplies behavior-specific slow-filesystem validation.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The supplied after-fix run exercises the changed fixture lifecycle through real filesystem writes and Root.walk: 6.03-second setup completes outside the unchanged test deadline, cancellation passes, and cleanup follows all 256 writes without a race. This is direct evidence for the test-infrastructure change, not merely an unrelated passing test suite.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The supplied after-fix run exercises the changed fixture lifecycle through real filesystem writes and Root.walk: 6.03-second setup completes outside the unchanged test deadline, cancellation passes, and cleanup follows all 256 writes without a race. This is direct evidence for the test-infrastructure change, not merely an unrelated passing test suite.
Evidence reviewed 6 items Applicable repository policy: Read the complete root AGENTS.md; no nested AGENTS.md or maintainer-notes directory was present. Applied focused-change, filesystem-safety, and changelog guidance. Did not run autoreview helpers or artifact-producing checks under the read-only review contract.
Introduced lifecycle repair: The pinned delta moves directory creation, all 256 writes, and Root construction into useSuiteFixture. Promise.allSettled drains every write before propagating a failure; cleanup belongs to the suite. Cancellation assertions and the test deadline remain unchanged.
Existing lifecycle helper and history: The helper provides a 30-second setup hook and drains pending work before cleanup. Blame points to prior merged fixture-lifetime work; the raw commit records parent dc6daf6, whose tree lacks this helper. GitHub commit metadata independently identifies steipete and the added helper.
Findings None None.
Security None None.

How this fits together

fs-safe provides root-confined filesystem operations for Node.js applications. This test prepares a real directory, exercises cancellation during a budgeted directory walk, and removes the fixture afterward.

flowchart TD
  A[256 fixture files] --> B[Suite setup deadline]
  B --> C[Root capability]
  C --> D[Budgeted directory walk]
  E[Cancellation timer] --> D
  D --> F[Cancellation assertions]
  F --> G[Drain work and remove fixture]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production versus test growth Production +0; test and validation code +114/-25; changelog +2 All executable growth supports fixture isolation and the opt-in slow-filesystem check; published runtime code is unchanged.

Technical review

Best possible solution:

Keep fixture preparation and cleanup under the established suite lifecycle while preserving the independent cancellation deadline and assertions.

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

Yes, source establishes that main charges all fixture writes to the test deadline; delaying those writes beyond five seconds provides a concrete trigger. The original Windows timeout's precise cause remains unconfirmed, and this review did not execute a reproduction.

Is this the best way to solve the issue?

Yes, reusing the existing suite helper isolates preparation without relaxing cancellation coverage, and draining all writes prevents cleanup from overtaking a rejected setup.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a bounded test-reliability improvement with no change to shipped filesystem behavior.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The supplied after-fix run exercises the changed fixture lifecycle through real filesystem writes and Root.walk: 6.03-second setup completes outside the unchanged test deadline, cancellation passes, and cleanup follows all 256 writes without a race. This is direct evidence for the test-infrastructure change, not merely an unrelated passing test suite.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The supplied after-fix run exercises the changed fixture lifecycle through real filesystem writes and Root.walk: 6.03-second setup completes outside the unchanged test deadline, cancellation passes, and cleanup follows all 256 writes without a race. This is direct evidence for the test-infrastructure change, not merely an unrelated passing test suite.

Label justifications:

  • P3: This is a bounded test-reliability improvement with no change to shipped filesystem behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The supplied after-fix run exercises the changed fixture lifecycle through real filesystem writes and Root.walk: 6.03-second setup completes outside the unchanged test deadline, cancellation passes, and cleanup follows all 256 writes without a race. This is direct evidence for the test-infrastructure change, not merely an unrelated passing test suite.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied after-fix run exercises the changed fixture lifecycle through real filesystem writes and Root.walk: 6.03-second setup completes outside the unchanged test deadline, cancellation passes, and cleanup follows all 256 writes without a race. This is direct evidence for the test-infrastructure change, not merely an unrelated passing test suite.

Evidence

What I checked:

  • Applicable repository policy: Read the complete root AGENTS.md; no nested AGENTS.md or maintainer-notes directory was present. Applied focused-change, filesystem-safety, and changelog guidance. Did not run autoreview helpers or artifact-producing checks under the read-only review contract. (AGENTS.md:1, 180a3b889abc)
  • Introduced lifecycle repair: The pinned delta moves directory creation, all 256 writes, and Root construction into useSuiteFixture. Promise.allSettled drains every write before propagating a failure; cleanup belongs to the suite. Cancellation assertions and the test deadline remain unchanged. (test/root-walk-budget.test.ts:329, 180a3b889abc)
  • Existing lifecycle helper and history: The helper provides a 30-second setup hook and drains pending work before cleanup. Blame points to prior merged fixture-lifetime work; the raw commit records parent dc6daf6, whose tree lacks this helper. GitHub commit metadata independently identifies steipete and the added helper. (test/helpers/suite-fixture.ts:25, 15d313de56d3)
  • Current main and release still need the change: Inspected the pinned-main version and v0.11.0 version of the cancellation test: both create the directory and await Promise.all inside the test callback. The release endpoint confirms v0.11.0 remains the latest release. No merged replacement was established. (test/root-walk-budget.test.ts:327, 5209566a355f)
  • Behavior-specific after-fix evidence: The complete supplied PR body reports the opt-in Node 24 run with native support disabled: cancellation passed after 6.03 seconds of setup, 256 actual writes completed, one directory removal occurred, and cleanup did not race writes. The inspected harness delays then delegates to real filesystem writes and checks removal and directory absence. This directly exercises the changed test lifecycle; it does not establish the cause of the original Windows timeout. The separate 28-test run is supplemental. (scripts/slow-walk-fixture.setup.ts:25, 180a3b889abc)
  • Review validation and inspection limits: The pinned diff passes whitespace checking and the checkout is clean. No tests or builds were executed. Two exploratory history searches encountered unavailable promised Git objects; direct commit records, blame, parent-tree inspection, and GitHub commit metadata supplied the relevant routing history. (180a3b889abc)

Likely related people:

  • Peter Steinberger: Raw commit 15d313d adds test/helpers/suite-fixture.ts:25 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 15d313de56d3; files: test/helpers/suite-fixture.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: test(walk): separate cancellation fixture setup from test timing This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete
steipete merged commit 67d2087 into main Sep 15, 2026
32 checks passed
@vincentkoc
vincentkoc deleted the codex/pass2-walk-fixture-20260915 branch September 25, 2026 11:15
@steipete steipete mentioned this pull request Oct 1, 2026
2 of 4 tasks
steipete added a commit that referenced this pull request Oct 1, 2026
Remove three scripts nothing runs (watch-hint-benchmark.mjs from #774, slow-walk-fixture config and setup from #406) and two workflow_dispatch registration stubs (path-prefix-performance.yml from #445, sync-lock-root-performance-proof.yml from #450) whose runs on main always failed and last ran on 2026-09-17. No package script, workflow, test, or document references them; their proofs remain in the introducing PRs and git history.
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. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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