Skip to content

test(reports): deduplicate native process census setup - #139596

Merged
steipete merged 1 commit into
mainfrom
codex/test-report-process-owner
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-report-process-owner

Conversation

@steipete

@steipete steipete commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Related: #139428

What Problem This Solves

Native process census setup is now duplicated inside the real subprocess-report case and its shared beforeEach. The original missing-census issue was independently fixed by #139496 and centralized by #139491 while this PR was being validated.

Why This Change Was Made

Remove only the redundant per-case restoration. The shared beforeEach still restores native spawnSync before every case, and report-only unit cases retain their explicit mock implementations. No production cleanup, deadline or signal policy changes.

User Impact

The real subprocess proof keeps its native Linux census with one setup owner. Four test lines removed; no scenarios or assertions removed.

Evidence

The full report-utils, managed-child-process and run-node-script suites pass 94 tests, with one existing Linux-only case skipped on macOS. Root-test types, script and changed-file lint, deslop, diff check and fresh independent P2 review pass.

The complete local changed gate is currently blocked by an unrelated services test-graph inventory count of 721 against its 720 cap. This removal changes no roots; no cap or ignore was changed. Required CI must pass before landing.

@clawsweeper

clawsweeper Bot commented Sep 6, 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.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Sep 6, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 11:06 PM ET / September 6, 2026, 03:06 UTC.

ClawSweeper review

What this changes

Removes redundant setup from the native subprocess-report test while retaining the shared setup, scenarios, and assertions.

Merge readiness

✅ Ready for maintainer review

This remains a useful, narrowly scoped cleanup: current main still duplicates the setup, and the retained shared hook preserves native process inspection. No actionable correctness finding remains; maintainer protection also excludes automatic closure.

Priority: P3
Reviewed head: f6ff86fc6e5ca5b0eeec147291774b68b65e1620

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving cleanup with reported validation and no blocking findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies a MEMBER-authored test-only cleanup, so the external-contributor proof gate does not apply; the native subprocess scenario remains intact and the body reports passing focused validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies a MEMBER-authored test-only cleanup, so the external-contributor proof gate does not apply; the native subprocess scenario remains intact and the body reports passing focused validation.
Evidence reviewed 6 items Pinned patch preserves the canonical setup: The introduced patch removes only the repeated restoration inside the native test. The awaited beforeEach at lines 97–102 resets the mock and installs actual.spawnSync before that case; the other report cases explicitly override it.
Current main still contains the duplication: Fetched main contains both the shared restoration and the identical per-case restoration. The cleanup therefore remains distinct work.
Native cleanup boundary remains intact: runNodeScript forwards requireProcessTreeExit to the managed process owner. That owner calls native spawnSync for Linux ps thread inspection; the patch leaves this owner, strict cleanup, timeout, report reuse, and result assertions unchanged.
Findings None None.
Security None None.

How this fits together

OpenClaw's test-report tooling launches Vitest and reads its JSON results. The affected test exercises real subprocesses, whose cleanup uses native Linux process inspection.

flowchart LR
  A[Shared test setup] --> B[Native process inspection enabled]
  B --> C[Real subprocess report test]
  C --> D[Vitest JSON report]
  C --> E[Process tree cleanup]
  D --> F[Report assertions]
  E --> F
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -4. Total -4 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 0 4 -4
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 0 4 -4

Review metrics

None.

Technical review

Best possible solution:

Keep native process inspection owned by the shared setup and preserve the existing real subprocess and report-only coverage.

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

Not applicable: this patch removes source-visible duplicate setup rather than fixing a remaining runtime defect.

Is this the best way to solve the issue?

Yes: removing the repeated per-case assignment is the narrowest cleanup because the awaited shared hook already installs the same native implementation.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is a low-risk test setup cleanup with no production behavior or coverage removal.
  • 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 supplied repository state identifies a MEMBER-authored test-only cleanup, so the external-contributor proof gate does not apply; the native subprocess scenario remains intact and the body reports passing focused validation.

Evidence

What I checked:

  • Pinned patch preserves the canonical setup: The introduced patch removes only the repeated restoration inside the native test. The awaited beforeEach at lines 97–102 resets the mock and installs actual.spawnSync before that case; the other report cases explicitly override it. (test/scripts/test-report-utils.test.ts:97, f6ff86fc6e5c)
  • Current main still contains the duplication: Fetched main contains both the shared restoration and the identical per-case restoration. The cleanup therefore remains distinct work. (test/scripts/test-report-utils.test.ts:97, cbcc1df2b32b)
  • Native cleanup boundary remains intact: runNodeScript forwards requireProcessTreeExit to the managed process owner. That owner calls native spawnSync for Linux ps thread inspection; the patch leaves this owner, strict cleanup, timeout, report reuse, and result assertions unchanged. (scripts/lib/managed-child-process.mts:259, f6ff86fc6e5c)
  • Related merged work and campaign scope: The supplied GitHub context identifies refactor(test): simplify catalog guards and fix native report fixture #139496 as the merged per-case repair and fix(cron): preserve current-session delivery intent #139491 as the merged shared-setup repair. The open campaign Test audit: reduce redundant test code and full-suite runtime #139428 explicitly lists this deduplication as pending reviewed work.
  • Area history supports routing: Path history includes several earlier merged changes by Peter Steinberger, including the shared native-probe setup commit. Its raw commit record names a parent and describes restoring native process probes. Parent-blob inspection failed, so exact source-line introduction is not asserted. (test/scripts/test-report-utils.test.ts, dca06c94c14d)
  • Validation and review continuity: The captured PR body reports 94 passing tests and one existing platform skip. The previous completed review retained no findings or rank-up moves. Tests were not executed during this read-only review; the earlier reviewed object, release file blob, and some history blobs could not be retrieved because GitHub DNS access failed. Release inclusion and exact earlier-head equivalence remain unverified. (f6ff86fc6e5c)

Likely related people:

  • 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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-09-06T01:24:37.795Z sha 283806c :: needs maintainer review before merge. :: none
  • reviewed 2026-09-06T01:30:24.838Z sha 283806c :: needs maintainer review before merge. :: none
  • reviewed 2026-09-06T02:44:37.777Z sha 179e28413f3c9001d7ab894ff229b6a2bec0bc06 :: needs maintainer review before merge. :: none

@steipete
steipete marked this pull request as ready for review September 6, 2026 01:26
@steipete steipete changed the title test(reports): preserve native process census in subprocess proof test(reports): deduplicate native process census setup Sep 6, 2026
@steipete
steipete force-pushed the codex/test-report-process-owner branch from 283806c to 179e284 Compare September 6, 2026 02:39
@steipete
steipete force-pushed the codex/test-report-process-owner branch from 179e284 to f6ff86f Compare September 6, 2026 03:01
@steipete
steipete merged commit a288654 into main Sep 6, 2026
117 checks passed
@steipete
steipete deleted the codex/test-report-process-owner branch September 6, 2026 03:12
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 6, 2026
* commit 'a2886546df92c3a601db538b1b70125e3519a16f':
  test(reports): deduplicate native process census setup (#139596)
  fix(ui): avoid refetching unrelated catalog hosts (#139570)
  test(compaction): consolidate classification proof at its owner (#139564)
  fix(apple): harden native state file permissions (#139623)
  improve(skills): review retained conversation for durable learning (#139656)
  fix(docker): stage bundled plugin runtime dependencies under the packaged plugin root (#139117)
  test: close HTTP fixtures before destroying their sockets (#139595)
  refactor(agents): simplify attempt execution and recovery (#139597)
  test(gateway): share HTTP authority scenarios (#139611)
  test(gateway): distinguish final CLI results from draft text (#139605)
  fix(shell-env): preserve CLI terminal ownership during login imports (#139308)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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