Skip to content

refactor(test): consolidate benchmark child teardown coverage - #158654

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/test-audit-benchmark-child-20260926
Sep 26, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/test-audit-benchmark-child-20260926

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

The startup and restart benchmark suites register the same child-teardown contract against the same stopChild implementation. Four cases therefore run twice without exercising different entry points or behavior.

Why This Change Was Made

Move the existing contract into a directly discovered owner test file and remove the generic registrar and its two callers. Keep both distinct queued exit codes, 0 and 7, as table rows. Preserve failed-signal classification, signal order, bounded teardown, IPC release, process-group cleanup, and Windows skips.

This is part of the maintainer-requested test audit. The patch removes four duplicate case executions and 27 net test/support lines. Production code and the benchmark CLI, fixture, probe, and reporting tests are unchanged.

User Impact

No user-visible change. Developers maintain one canonical child-teardown suite without losing the distinct exit and cleanup contracts.

Evidence

  • Baseline: all 66 cases across the startup and restart suites passed.
  • Retained coverage: 62 cases across the two benchmark suites and the new child suite. The first final run passed 61; the unchanged incident-fixture case encountered SQLite disk is full on the saturated configured temp filesystem. That case passed when rerun alone using task-owned temp storage on a volume with sufficient space, without code or assertion changes.
  • Three temporary production mutations caused four intended failures: incorrect failed-signal exit classification, missing IPC release, and skipped process-group cleanup in both exit orderings. Only the mocked child suite ran against those mutations. Production was restored byte-for-byte before the final real-CLI run.
  • Baseline 31.34 seconds; first final run 53.54 seconds, including cold worker compilation; targeted fixture rerun 18.00 seconds. These are execution costs, not speedup evidence.
  • The new owner file also passed alone with one worker: six cases, 1.58 seconds Vitest duration and 3.607 seconds command wall time including runner startup.
  • All 17 selected changed-file checks passed, including root-test types, all three unused-export scans, script lint, and changed-test lint. Formatting, diff checks, and fresh independent review also passed.
  • The original-head CI run finished cancelled after an upstream failure: 838 seconds elapsed, 132 total jobs, 110 non-skipped jobs, and 31,440 summed job-wall seconds. These are whole-run costs, not the new owner's file-local CI time or speedup evidence; file-local CI timing is not available from the run metadata.
  • The only failing test shard, compact-small-38, reports test/scripts/lint-suppressions.test.ts:191: 78 actual suppressions versus 77 expected. Main commit 2f2ec46dd56, from the progress-snapshot PR, added src/gateway/server-chat-progress-snapshot.ts|no-implicit-coercion|1 without changing that inventory. Both affected files are unchanged by this cleanup. One other shard was cancelled by fail-fast, and the aggregate gate failed. The same upstream defect is independently recorded in the QA PR.
  • The owning main repair d6dc69c02df records the existing suppression and preserves JSON ToNumber semantics. The first patch-identical refresh was 34b1c9ba41dc9b9ea203afbd5a20a1fd57099d81.
  • That refresh's CI hit a different main-side defect in compact-small-23: the filesystem import guard rejected the direct atomic-helper import in extensions/acpx/src/session-owner-migration.ts. The failing guard and migration are outside this cleanup. Other affected shards were cancelled by fail-fast.
  • Main repair 9d5ab59b5af8 uses the existing SDK export without changing migration behavior or the guard. The second patch-identical refresh was d4508fd570e2d45c471390a481fbf088e88331f6.
  • That head's CI failed the additional-boundaries check on src/gateway/server-chat-progress-snapshot.ts:36:24: lint:no-chained-type-assertions rejected value as unknown as number, introduced by main 20f3170d367. That source file is unchanged by this cleanup.
  • The owner repair 66b812f26e7 preserves the same native numeric coercion through Reflect.apply without the chained assertion. This PR is refreshed onto the repaired main snapshot as 8c546ab2690609755a54f0f1d90869d0518e62fc. Cleanup patch bytes, owner/callee sources, dependency inputs, and relevant test routing remain unchanged; existing local proof is preserved. No guard weakening or same-head CI retry.
  • Fresh exact-head CI passed on 8c546ab2690609755a54f0f1d90869d0518e62fc: 132 jobs, 110 non-skipped, and 813 seconds workflow elapsed. These are aggregate costs, not file-local timing or speedup evidence. The completed review reports no findings or before-merge actions on the patch-identical previous head.
  • The exact failed-job log request ended with a transport cancellation, so attribution uses the structured GitHub failure annotation and inspected source/history, not an unavailable log.
  • No local Windows or full-repository run.

@vincentkoc vincentkoc self-assigned this Sep 26, 2026
@clawsweeper

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

@vincentkoc
vincentkoc marked this pull request as ready for review September 26, 2026 04:49
@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 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 26, 2026, 2:06 AM ET / 06:06 UTC (Revision 4).

ClawSweeper review

What this changes

Moves Gateway benchmark child teardown checks into one discovered test suite and removes their duplicate registrations from the startup and restart suites.

Merge readiness

✅ Ready for maintainer review

Keep open. Current main still runs the same teardown contract in both benchmark suites, and this useful consolidation retains the distinct exit-code cases. No introduced defect was found.

Priority: P3
Reviewed head: d4508fd570e2d45c471390a481fbf088e88331f6

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative test consolidation retains the relevant contracts and reports strong validation, with no identified patch defect.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The contributor proof gate does not apply to this member-authored test-only refactor. The new discovered suite calls the production stopChild helper with synthetic child states; the PR body reports focused runs and mutation checks, while stored-data contracts are untouched.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The contributor proof gate does not apply to this member-authored test-only refactor. The new discovered suite calls the production stopChild helper with synthetic child states; the PR body reports focused runs and mutation checks, while stored-data contracts are untouched.
Evidence reviewed 8 items PR introduction: The introduced diff removes both registrations and converts the shared support file into a discovered suite; the queued exit cases remain as rows for codes 0 and 7.
Current-main duplication: Current main registers the shared teardown tests in the restart suite with queued exit code 0.
Current-main duplication: Current main separately registers that same helper in the startup suite with queued exit code 7.
Findings None None.
Security None None.

How this fits together

OpenClaw's startup and restart benchmarks manage Gateway child processes and report their exit outcomes. Tooling tests feed child exit and signal scenarios into the shared teardown helper to check classification and cleanup.

flowchart LR
  A[Startup and restart benchmarks] --> B[Gateway child process]
  B --> C[Shared teardown helper]
  D[Teardown test cases] --> C
  C --> E{Exit or timeout}
  E --> F[Process tree cleanup]
  F --> G[Benchmark outcome]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -27. Total -27 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 33 60 -27
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 33 60 -27

Review metrics

Metric Value Why it matters
Teardown case executions 4 duplicate executions removed; 6 cases retained The shared contract runs once while both queued exit-code variants remain covered.

Technical review

Best possible solution:

Keep one discovered suite for the shared teardown contract while retaining separate startup and restart tests for their distinct benchmark behavior.

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

Not applicable to a bug report. Current-main source confirms the duplicated registrations against the same teardown helper.

Is this the best way to solve the issue?

Yes. A directly discovered owner suite removes duplicate execution while preserving the two exit-code inputs and the other teardown assertions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 02192bc72c02.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is a low-risk developer test cleanup with no reported user-facing behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The contributor proof gate does not apply to this member-authored test-only refactor. The new discovered suite calls the production stopChild helper with synthetic child states; the PR body reports focused runs and mutation checks, while stored-data contracts are untouched.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: 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-26T04:55:38.853Z sha 9401bd8 :: needs changes before merge. :: none
  • reviewed 2026-09-26T05:01:01.060Z sha 9401bd8 :: needs changes before merge. :: none
  • reviewed 2026-09-26T05:33:16.309Z sha 9401bd8 :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc force-pushed the refactor/test-audit-benchmark-child-20260926 branch 2 times, most recently from 34b1c9b to d4508fd Compare September 26, 2026 05:52
@vincentkoc
vincentkoc force-pushed the refactor/test-audit-benchmark-child-20260926 branch from d4508fd to 8c546ab Compare September 26, 2026 06:21
@vincentkoc
vincentkoc merged commit 618217c into main Sep 26, 2026
170 checks passed
@vincentkoc
vincentkoc deleted the refactor/test-audit-benchmark-child-20260926 branch September 26, 2026 06:50
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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