Skip to content

test(process): share relay startup fixtures - #140345

Merged
steipete merged 1 commit into
mainfrom
steipete/deslop-tests-process-relay
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/deslop-tests-process-relay

Conversation

@steipete

@steipete steipete commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Related: #135868, #139517

What Problem This Solves

The Stage 3 process cleanup tests repeat relay startup fixtures across two abort timings and the supervisor cleanup joins. This is the maintainer-requested test compression pass for concern C of the #135868 split, after reviewing #139937 and #139953.

Why This Change Was Made

Table-drive the two startup timings and share their immediately writable relay fixture with the existing Linux/Windows supervisor cases. Keep the independent deferred cancellation writer, the abort → deferred delivery failure → rejection observation order, and all repeated cleanup joins.

User Impact

No runtime behavior changes. All test cases remain. Tests shrink by 34 lines (+31/−65); production, tooling, and docs each change by zero.

Evidence

Removed repetition or assertion Surviving coverage
Separate startup-abort body src/process/supervisor/service-child-relay-host.test.ts:162, “reports cleanup uncertainty when construction aborts before ready”
Separate deferred-start-failure body and callback cast Same table at :162, “reports cleanup uncertainty when deferred start delivery fails after abort”; a typed callback retains the same delivery ordering
Repeated writable Duplex/stdio fixtures Startup table at :162 and src/process/supervisor/service-child-relay-host.test.ts:205, “keeps rejected construction ownership failures visible to supervisor joins (%s)”, both Linux and Windows rows
Spawn mock call assertion Startup table at :162 requires the spawned child's SIGKILL and the original cleanup-identity rejection
Three unused unref mock assignments Relay owner never invokes them; actual referenced-host lifetime remains covered by src/process/supervisor/supervisor.anchored-shell.real.test.ts:240, “completes an otherwise idle host with %s command environment”

Real process groups, owned stdio, output flushing, scope extinction, retained descendants, kernel census, and relay-reaping/deadline tests remain unchanged. This patch does not revisit the distinct ownership cases retained by the previous Stage 3 compression pass.

Full src/process suite before: 44 files, 634 passed / 63 skipped, 35.06 s. After: the same 44 files and case counts, 40.57 s. Real-process cases ran on macOS; Windows cases retain their fixtures. Full node scripts/check-changed.mjs passed, including test types, lint, guards, and all three dead-export scans. Independent Codex autoreview is scoped-clean through P2; git diff --check passed. File size: 592 → 558 lines.

Exact-head CI is green for 087c0000f9ba546ebeb8dc397d27676b732055c4: https://github.com/openclaw/openclaw/actions/runs/34050481521 . ClawSweeper reviewed that head with no findings, before-merge requests, or rank-up moves.

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

@steipete
steipete marked this pull request as ready for review September 6, 2026 17:55
@openclaw-barnacle openclaw-barnacle Bot added size: S 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 6, 2026, 2:09 PM ET / 18:09 UTC.

ClawSweeper review

What this changes

Shares relay startup test fixtures and combines two abort scenarios into a table while preserving cleanup-failure coverage.

Merge readiness

✅ Ready for maintainer review

Keep open as a useful, maintainer-requested cleanup. The retained assertions preserve both startup-abort timings and repeated cleanup joins; no actionable correctness or security defect was found. Current main still contains the duplicated fixtures.

Priority: P3
Reviewed head: 087c0000f9ba546ebeb8dc397d27676b732055c4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused test cleanup with preserved behavioral coverage and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored PR changes only fixtures around the unchanged relay owner, so the external-contributor runtime-proof gate does not apply; reported suite runs supplement the source review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored PR changes only fixtures around the unchanged relay owner, so the external-contributor runtime-proof gate does not apply; reported suite runs supplement the source review.
Evidence reviewed 6 items Introduced patch and retained scenarios: The pinned merge-base-to-head diff changes only the relay test file. Both startup timings retain cleanup-identity rejection and SIGKILL assertions; Linux and Windows supervisor cases retain initial and repeated cleanup-join rejection checks.
Fixture and production contract: The complete test and relay owner were inspected. The shared writable Duplex preserves immediate write completion, while the separate cancellation fixture still defers callbacks. The production owner never invokes child.unref and preserves cleanup failure independently of command results.
Current-main necessity: Comparison with fetched main shows the same fixture consolidation remains outstanding. The relay production owner is unchanged between fetched main and this head; this is a test cleanup, not a runtime fix or upgrade.
Findings None None.
Security None None.

How this fits together

OpenClaw's process supervisor launches commands through a relay and tracks command completion separately from descendant cleanup. These tests check that interrupted startup leaves cleanup uncertainty visible to shutdown and scope owners.

flowchart LR
  A[Command request] --> B[Process supervisor]
  B --> C[Relay startup]
  D[Startup abort or delivery failure] --> C
  C --> E[Command result]
  C --> F[Cleanup outcome]
  F --> G[Scope and shutdown joins]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -34. Total -34 across 1 file.

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

Review metrics

None.

Technical review

Best possible solution:

Keep the shared fixture while preserving distinct startup timing, deferred cancellation, and repeated cleanup-failure assertions.

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

Not applicable: this PR consolidates existing tests rather than reporting a new runtime defect; no tests were executed during this read-only review.

Is this the best way to solve the issue?

Yes: a file-local shared fixture and two named table rows remove repetition while retaining the meaningful failure assertions and event ordering.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is a bounded test-maintenance improvement with no production 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 maintainer-authored PR changes only fixtures around the unchanged relay owner, so the external-contributor runtime-proof gate does not apply; reported suite runs supplement the source review.

Evidence

What I checked:

  • Introduced patch and retained scenarios: The pinned merge-base-to-head diff changes only the relay test file. Both startup timings retain cleanup-identity rejection and SIGKILL assertions; Linux and Windows supervisor cases retain initial and repeated cleanup-join rejection checks. (src/process/supervisor/service-child-relay-host.test.ts:160, 087c0000f9ba)
  • Fixture and production contract: The complete test and relay owner were inspected. The shared writable Duplex preserves immediate write completion, while the separate cancellation fixture still defers callbacks. The production owner never invokes child.unref and preserves cleanup failure independently of command results. (src/process/supervisor/service-child-relay-host.ts:314, 087c0000f9ba)
  • Current-main necessity: Comparison with fetched main shows the same fixture consolidation remains outstanding. The relay production owner is unchanged between fetched main and this head; this is a test cleanup, not a runtime fix or upgrade. (src/process/supervisor/service-child-relay-host.test.ts:140, 3967d9b6df1f)
  • Validation and review continuity: The supplied complete PR body reports identical before/after process-suite totals of 634 passing and 63 skipped tests, macOS real-process execution, and successful changed checks. These are contributor-reported results, not reviewer executions. The previous completed review lists no findings or rank-up requests. Its earlier head was unavailable locally, so patch identity across the force-push was not established. (087c0000f9ba)
  • Related work and maintainer scope: The supplied discussion identifies this as a requested follow-up to merged process-cleanup work at fix(process): require cleanup evidence before releasing owned work #139517. The related open recovery PR, feat(triage): start installation-owned recovery after update and startup failures #135868, addresses a separate runtime capability and does not supersede this test consolidation. Repository State identifies MEMBER authorship, and the PR carries the protected maintainer label.
  • Area history and routing: Current-main file history repeatedly records Peter Steinberger on relay cleanup, startup ownership, and reaping changes, supporting routing beyond authorship of this proposal. Exact line-introduction verification could not complete because historical blobs were unavailable; no introduction claim is made. (src/process/supervisor/service-child-relay-host.test.ts, b8ef27d69475)

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 (1 earlier review cycle)
  • reviewed 2026-09-06T18:01:42.501Z sha 4e69fa630947daceb91da17fc26228bfc0829575 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the steipete/deslop-tests-process-relay branch from 4e69fa6 to 087c000 Compare September 6, 2026 18:03
@steipete
steipete merged commit 7f0b4d3 into main Sep 6, 2026
101 checks passed
@steipete
steipete deleted the steipete/deslop-tests-process-relay branch September 6, 2026 18:21
@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
* origin/main: (25 commits)
  docs(releases): keep the release-notes nav group to version routes (#140353)
  fix(ui): hide trust wrappers in imported chat history
  fix(subagents): subagent list building decodes unrelated saved prompts in large session stores (#139540)
  test(process): share relay startup fixtures (#140345)
  refactor(doctor): inline GitHub skill discovery inputs (#140343)
  refactor(ui): share channel status type definitions (#140331)
  refactor: simplify queue state and infrastructure dispatch (#140311)
  fix: require saved agent turns before update verification succeeds (#140274)
  fix(update): keep the service profile when switching to Git (#140263)
  fix(ui): prevent image avatars overlapping mobile chat (#140341)
  fix(test): accept release subpages in docs route shape (#140337)
  refactor(plugins): share uninstall mutation ownership (#140322)
  refactor(agents): use canonical tool execution arguments (#140280)
  perf(cli): keep inference metadata and domain help lazy (#140327)
  refactor(plugins): simplify self-hosted setup results (#140332)
  refactor(config): reuse parent lookup for unset operations (#140326)
  fix(plugins): preserve exact installed-index mutation receipts (#140328)
  test(agents): simplify MCP and LSP boundary fixtures (#140312)
  fix(ui): preserve literal source previews and copied whitespace (#140306)
  fix: OpenCode Go/Zen requests are missing the required x-opencode-session header (#137464)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 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: S 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