Skip to content

fix(test): stop asserting immediate buffer reclamation - #99

Merged
vincentkoc merged 1 commit into
mainfrom
fix/plugin-inspector-resource-gc-test
Oct 1, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/plugin-inspector-resource-gc-test

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes: the Node 22 CI suite fails when V8 does not reclaim an unreferenced buffer during the test's single forced-GC turn.

User Impact

User impact: no runtime behavior changes; CI no longer treats V8 garbage-collection timing as a plugin-inspector resource-accounting contract.

Why This Change Was Made

The test already proves positive buffer growth and timer disposal, while the next test independently proves signed memory deltas. Immediate backing-store reclamation is controlled by V8, not captureProcessResources() or diffProcessResources(), and failed twice on the same hosted runner after an earlier stabilization attempt.

Evidence

@vincentkoc vincentkoc self-assigned this Oct 1, 2026
@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

🦞👀
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. 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 Oct 1, 2026
@clawsweeper

clawsweeper Bot commented Oct 1, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 6:14 AM ET / 10:14 UTC.

ClawSweeper review

What this changes

Removes the test assertion that an unreferenced buffer must be fully reclaimed immediately after one forced garbage-collection turn.

Merge readiness

✅ Ready for maintainer review

This remains a useful, narrowly scoped test fix: current main retains the GC-timing assertion, and the patch preserves the documented resource-accounting contract. No actionable patch defect was found.

Priority: P3
Reviewed head: 103a69f1f1892c0222fb8ea91cf4bbf54c6b9c55

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused test correction preserves useful coverage and has successful reported validation, with no actionable defect found.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored patch changes only a test assertion and leaves the production resource helpers unchanged; reported repeated test passes and successful checks are supplemental validation. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored patch changes only a test assertion and leaves the production resource helpers unchanged; reported repeated test passes and successful checks are supplemental validation. No stored-data contract changes.
Evidence reviewed 8 items Verified introduced change: The pinned main-to-head diff removes exactly one immediate ArrayBuffer reclamation assertion. The verified test-merge result contains the same removal and no production changes.
Preserved coverage: The remaining child-process test verifies CPU work, positive retained-buffer growth, and timer creation/disposal. The following JSON-transport test independently verifies negative heap and positive external-memory differences.
Production contract: Capture reads process.memoryUsage(); differences subtract recorded endpoints uniformly across memory fields. README's In-process resource snapshots section explicitly says capture does not force GC and memory deltas represent signed endpoint changes.
Findings None None.
Security None None.

How this fits together

Plugin Inspector's resource helpers capture CPU, memory, and active-resource observations inside a measured Node process. Its tests check that snapshots and endpoint differences accurately describe those observations.

flowchart LR
 A[Measured Node process] --> B[Resource snapshots]
 B --> C[Endpoint differences]
 C --> D[CPU and memory observations]
 C --> E[Active resource changes]
 D --> F[Resource contract tests]
 E --> F
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production versus test delta production +0/-0, tests +0/-1 The fix removes a GC-timing assertion without growing or changing production code.

Technical review

Best possible solution:

Keep resource tests deterministic by checking observed endpoint accounting without requiring a particular V8 reclamation schedule.

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

No deterministic current-main reproduction was established: the failure depends on GC timing. Source confirms the timing-sensitive assertion, and the linked Node 22 attempt failed, but detailed failure logs were unavailable.

Is this the best way to solve the issue?

Yes: removing the unsupported reclamation deadline is a focused correction, while positive allocation, timer disposal, and signed memory accounting remain covered.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a bounded test-reliability correction with no runtime behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER-authored patch changes only a test assertion and leaves the production resource helpers unchanged; reported repeated test passes and successful checks are supplemental validation. No stored-data contract changes.

Label justifications:

  • P3: This is a bounded test-reliability correction with no runtime behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER-authored patch changes only a test assertion and leaves the production resource helpers unchanged; reported repeated test passes and successful checks are supplemental validation. No stored-data contract changes.

Evidence

What I checked:

  • Verified introduced change: The pinned main-to-head diff removes exactly one immediate ArrayBuffer reclamation assertion. The verified test-merge result contains the same removal and no production changes. (test/resource-profile.test.js:55, 103a69f1f189)
  • Preserved coverage: The remaining child-process test verifies CPU work, positive retained-buffer growth, and timer creation/disposal. The following JSON-transport test independently verifies negative heap and positive external-memory differences. (test/resource-profile.test.js:49, 103a69f1f189)
  • Production contract: Capture reads process.memoryUsage(); differences subtract recorded endpoints uniformly across memory fields. README's In-process resource snapshots section explicitly says capture does not force GC and memory deltas represent signed endpoint changes. (src/resource-profile.js:50, 103a69f1f189)
  • Still necessary on main: The fetched main revision, identified in Repository State as release v0.3.27, still contains the removed assertion at line 56. The latest-release API confirms v0.3.27; this change is not already present in that inspected source. (test/resource-profile.test.js:56, b8321a836f69)
  • Earlier stabilization context: Merged fix: stabilize resource-profile measurement tests #94 corrected clock precision and net-allocation assertions while retaining full disposal coverage. Its patch confirms those were different failure mechanisms from the immediate-reclamation assertion now removed. (test/resource-profile.test.js, 19f481f19f06)
  • Merged feature history: Merged feat: measure resources at workload phase boundaries #91, authored by vincentkoc, introduced the resource API and explicitly disclaimed forced GC and complete cleanup detection. This provides prior merged-area context beyond authorship of the current proposal. (src/resource-profile.js, e2f36f1cdf94)

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

@vincentkoc
vincentkoc marked this pull request as ready for review October 1, 2026 10:16
@vincentkoc
vincentkoc merged commit 71537c3 into main Oct 1, 2026
7 checks passed
@vincentkoc
vincentkoc deleted the fix/plugin-inspector-resource-gc-test branch October 1, 2026 10:16
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: 🐚 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