Skip to content

test(infra,workers): remove low-value tests (batch d184) - #164628

Merged
steipete merged 11 commits into
mainfrom
tcr/land-d184-1791069879
Oct 4, 2026
Merged

steipete merged 11 commits into
mainfrom
tcr/land-d184-1791069879

Conversation

@steipete

@steipete steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Infrastructure and worker tests repeat fixtures and overlapping variants, increasing maintenance cost without independent regression coverage.

User Impact

No user-visible behavior changes. This batch changes only 58 test files: +4,072/-6,137 test LOC (net -2,065), with zero production or shared-support LOC changes.

Why This Change Was Made

Consolidate repeated scenarios into tables and shared local fixtures, remove duplicate variants and redundant assertions, and retain distinct authority, cancellation, durability, recovery, and migration regressions. All ten campaign commits replayed in order onto main at 4bcd6956b0a431b3d7024f1ad13095947c242bf8; none were skipped. No conflicts or dropped hunks. Existing main behavior, including the worker-capacity fixture and newer schema-admission cases, is retained.

Independent review identified three distinct cases to retain: unsafe-integer cadence, the original three snapshot acquisition/transfer combinations, and unnumbered claim-only audit-migration recovery with claim removal. These were restored within the existing tables. Two other findings were rejected after source inspection: the reserved archive-generation row already retains the full interrupted-downgrade scenario; the removed publication byte-budget replay manually constructed its binding entry and repeated the canonical comparator boundary already covered by the retained reconciliation test. The remaining publication test still asserts actual binding payload bytes.

No paths match the current CODEOWNERS file.

Evidence

  • Blacksmith Testbox: all 844 tests in the 58 touched files passed. After the three review restorations, all 65 tests in those three files passed again (29.79s).
  • On the same refreshed Testbox tree, OPENCLAW_TESTBOX=1 node scripts/check-changed.mjs --base 4bcd6956b0a431b3d7024f1ad13095947c242bf8 -- <58 changed paths> passed: all five TypeScript graphs, type-aware lint, formatting, dead-export scans, boundary checks, and ratchets. The child marker kept the gate on Testbox. Combined focused rerun plus changed-gate command: 488.467s, exit 0.
  • Blacksmith proof run, lease tbx_01m421j4bnbdkt7f46mdv7k0ft. Proof is the successful command exit/timing receipt; external lease cleanup can cancel the hosting workflow.
  • Local oxfmt, plain oxlint -c .oxlintrc.json across all 58 files, and git diff --check passed.
  • Independent review: three findings accepted and restored; two rejected with retained-test/source evidence above. Focused review of the restorations passed with no actionable P0–P2 findings.
  • No validation gap. Testbox portal-status synchronization emitted a nonfatal timeout after the remote command had succeeded.

The coverage figures below are historical in-shard before/after proof, not fresh coverage measurements on this PR base. Every comparison stays within the campaign's 1% covered-statement/branch budget. Declaration counts include table declarations and do not equal executed test counts. Metrics below are measured across the selected commits' changed files and include the review restorations, rather than the older full-shard totals.

Shard Files Test LOC before → after Declarations before → after
u0242 6 1,898 → 1,781 (-117) 50 → 36 (-14)
u0227 7 3,243 → 3,021 (-222) 68 → 53 (-15)
u0243 6 2,611 → 2,268 (-343) 74 → 47 (-27)
u0230 4 1,335 → 1,199 (-136) 25 → 17 (-8)
u0246 6 1,782 → 1,621 (-161) 46 → 34 (-12)
u0231 5 1,125 → 1,072 (-53) 29 → 20 (-9)
u0247 6 1,472 → 1,338 (-134) 35 → 24 (-11)
u0244 6 2,867 → 2,376 (-491) 82 → 55 (-27)
u0248 6 3,063 → 2,888 (-175) 76 → 60 (-16)
u0241 6 4,201 → 3,968 (-233) 93 → 71 (-22)
Total 58 23,597 → 21,532 (-2,065) 578 → 417 (-161)
Shard coverage and evidence qualifications
u0242: covered statements 4873 -> 4871 (-2); branches 2611 -> 2610 (-1); functions 944 -> 944 (0)
u0227: covered statements 2534 -> 2534 (0); branches 1850 -> 1850 (0); functions 545 -> 545 (0)
u0243: covered statements 5443 -> 5452 (9); branches 2720 -> 2725 (5); functions 1086 -> 1088 (2)
u0230: covered statements 2401 -> 2397 (-4); branches 1143 -> 1142 (-1)
u0246: covered statements 4073 -> 4073 (0); branches 1990 -> 1990 (0); functions 758 -> 758 (0)
u0231: covered statements 7548 -> 7546 (-2); branches 4051 -> 4049 (-2); functions 1479 -> 1478 (-1)
u0247: covered statements 3298 -> 3298 (0); branches 1799 -> 1799 (0); functions 668 -> 668 (0)
u0244: covered statements 4124 -> 4133 (9); branches 2216 -> 2220 (4); functions 779 -> 781 (2)
u0248: covered statements 7726 -> 7726 (0); branches 4047 -> 4047 (0); functions 1506 -> 1506 (0)
u0241: covered statements 5613 -> 5613 (0); branches 3008 -> 3008 (0); functions 1007 -> 1007 (0)

u0231 uses the finished-commit log, superseding the initial report blocked by Testbox infrastructure. Its selected five files exactly match the subsequently repaired and validated commit. The repair validation independently records 7,548→7,545 statements and 4,051→4,049 branches with no failed groups; the finished comparison differs by one statement and also passes.

u0241 uses a supplemental seven-file comparison covering every edited file. Its original full-shard comparison excluded a group with an obsolete assertion in the unchanged filesystem test. Main already corrected that assertion in #164438 (f79dac86bd4); this batch does not reintroduce it.

u0230 uses the repaired baseline across all four files. Its four-statement/one-branch decrease is in workspace manifest parsing, with retained byte-boundary proof in the reconciliation and manifest-worker suites. u0243 has one individual worker-pool branch decrease despite aggregate gains. u0227, u0246, u0247, u0244, u0248, and u0241 recorded no per-file drops.

Files touched by each shard

u0242: src/infra/package-update-swap.integrity.test.ts, src/infra/package-update-swap.windows.test.ts, src/infra/ports-probe.test.ts, src/infra/push-apns-store.worker-read.test.ts, src/infra/restart-stale-pids.authority.test.ts, src/infra/restart-stale-pids.cwd.test.ts.

u0227: src/gateway/worker-environments/placement-session-tool-operations.worker.test.ts, src/gateway/worker-environments/placement-turn-authority.test.ts, src/gateway/worker-environments/placement-turn-claims.worker.test.ts, src/gateway/worker-environments/placement-worker-gate.test.ts, src/gateway/worker-environments/placement-workspace-journal.test.ts, src/gateway/worker-environments/prepared-pool-maintenance.test.ts, src/gateway/worker-environments/project-preparation-verification.test.ts.

u0243: src/infra/restart.deferral-timeout.test.ts, src/infra/run-node-static-assets.test.ts, src/infra/run-node.live-dist.test.ts, src/infra/run-node.runtime-postbuild.test.ts, src/infra/safe-package-install.test.ts, src/infra/session-cost-usage-cache.admission.test.ts.

u0230: src/gateway/worker-environments/worker-turn-rpc.gateway-tools.test.ts, src/gateway/worker-environments/worker-turn-rpc.live-ack.test.ts, src/gateway/worker-environments/workspace-local-reconciliation.test.ts, src/gateway/worker-environments/workspace-publication-input.test.ts.

u0246: src/infra/sqlite-schema-facts.test.ts, src/infra/sqlite-snapshot-cow.test.ts, src/infra/sqlite-snapshot-retirement.test.ts, src/infra/sqlite-snapshot-single-flight.test.ts, src/infra/sqlite-snapshot-staging-runtime.test.ts, src/infra/sqlite-snapshot-staging.cancellation.test.ts.

u0231: src/index.entrypoint.test.ts, src/infra/agent-activity-events.test.ts, src/infra/agent-database-readers.test.ts, src/infra/backup-create.ownership.test.ts, src/infra/backup-retention.test.ts.

u0247: src/infra/sqlite-snapshot.transfer.test.ts, src/infra/sqlite-transaction.diagnostics.test.ts, src/infra/sqlite-wal-checkpoint.test.ts, src/infra/sqlite-wal.checkpoint-tick.test.ts, src/infra/sqlite-worker-contract.test.ts, src/infra/sqlite-worker-input-preparation.test.ts.

u0244: src/infra/session-cost-usage-worker-refresh.test.ts, src/infra/session-delivery-queue-runtime.test.ts, src/infra/session-event-wake.poll-disposition.test.ts, src/infra/shell-env.test.ts, src/infra/sqlite-exit-close.test.ts, src/infra/sqlite-index-corruption.test.ts.

u0248: src/infra/sqlite-worker-transcripts.test.ts, src/infra/ssh-tunnel.test.ts, src/infra/startup-migration-checkpoint.inspection.test.ts, src/infra/state-migrations.audit-logs.test.ts, src/infra/state-migrations.media-persistence.canonical-archives.test.ts, src/infra/state-migrations.meeting-transcripts-stage-cleanup.test.ts.

u0241: src/infra/package-dist-inventory.test.ts, src/infra/package-lifecycle.ownership.test.ts, src/infra/package-update-activation-durability.test.ts, src/infra/package-update-activation-journal.test.ts, src/infra/package-update-activation-lifetime.test.ts, src/infra/package-update-lifecycle.test.ts.

Port shard u0227 while preserving the lane capacity fixture fix already present from de8845f049052aa276c36e9829e8baaa7572f234. Apply the test consolidations from 9b79bc4bbe524e408497a0826a4c8651e6bd35fb.

Validated on Blacksmith Testbox from fresh main c732cad plus the seven resolved test files: 99 tests passed across 7 files, no skips. Focused oxlint, oxfmt, diff checks, and independent review passed.
Port 9ac90ae875b72b33841f216daf5096e15273a11b and 933ab48ef072b29fbc762b488883f2ce2f7c0b9b onto the campaign lane. Preserve the newer tool-presentation fixture and both schema-admission cases from HEAD.

Validation: fresh-main small-delta Testbox checkout, 4 files and 39 tests passed with no skips (33.04s); oxlint, oxfmt --check, and git diff --check passed. Independent review found no actionable issues.
@clawsweeper

clawsweeper Bot commented Oct 4, 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 gateway Gateway runtime size: XL labels Oct 4, 2026
@steipete
steipete enabled auto-merge (squash) October 4, 2026 00:05
@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 Oct 4, 2026
@clawsweeper

clawsweeper Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 3, 2026, 8:09 PM ET / October 4, 2026, 00:09 UTC.

ClawSweeper review

What this changes

The branch consolidates infrastructure and worker regression tests into shared fixtures and tables while removing overlapping scenarios and assertions.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a coherent test consolidation that remains distinct from current main. No blocking correctness defect was identified in the reviewed changes.

Priority: P3
Reviewed head: 7e10f481207c338b6a275a445834de65d6db30b2

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, coherent consolidation with retained boundary regressions and no identified blocking defect; test execution was not independently repeated.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied Repository State identifies a MEMBER-authored test-only PR, so contributor runtime proof is not required. The reported Testbox results are supplemental validation; no production authority or stored-data contract changes require separate final-effect or upgrade proof.
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 PR, so contributor runtime proof is not required. The reported Testbox results are supplemental validation; no production authority or stored-data contract changes require separate final-effect or upgrade proof.
Evidence reviewed 8 items Introduced scope and merge ownership: The pinned introduced delta contains only test files. The verified test merge records the supplied base parent followed by the exact PR head, and its comparison against that base also contains only the test changes; unrelated endpoint drift is not attributed to this PR.
Snapshot acquisition and transfer cases retained: The consolidated table retains ordinary acquisition, isolated acquisition, and copy fallback. It checks the single private image, publication receipt, unchanged source, SQLite integrity, preserved row ID, and payload bytes.
Audit recovery cases retained: The generation table retains claim-only recovery, interrupted sanitized publication, active sources, and reserved generations. Claim-only recovery checks detection, imported rows, raw archive creation, and removal of the original claim.
Findings None None.
Security None None.

How this fits together

OpenClaw’s infrastructure manages updates, SQLite storage, recovery, and background delivery, while worker environments manage remote session execution. These tests supply controlled inputs and faults to those owners and check their observable outcomes.

flowchart TD
  A[Controlled fixtures and faults] --> B[Parameterized regression tests]
  B --> C[Worker session lifecycle]
  B --> D[Updates and SQLite storage]
  C --> E[Behavior and recovery assertions]
  D --> E
  E --> F[Test runner and CI results]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -2065. Total -2065 across 58 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 58 4051 6116 -2065
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 58 4051 6116 -2065

Review metrics

None.

Technical review

Best possible solution:

Keep distinct lifecycle, cancellation, durability, and recovery regressions at their owning boundaries while sharing repeated setup.

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

Not applicable: this PR reduces test duplication rather than repairing a reported runtime failure.

Is this the best way to solve the issue?

Yes: local fixtures and parameterized cases are an appropriate way to consolidate these tests, and the inspected retained cases preserve important independent boundaries.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is internal test-maintenance cleanup with no introduced production 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 supplied Repository State identifies a MEMBER-authored test-only PR, so contributor runtime proof is not required. The reported Testbox results are supplemental validation; no production authority or stored-data contract changes require separate final-effect or upgrade proof.

Label justifications:

  • P3: This is internal test-maintenance cleanup with no introduced 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 supplied Repository State identifies a MEMBER-authored test-only PR, so contributor runtime proof is not required. The reported Testbox results are supplemental validation; no production authority or stored-data contract changes require separate final-effect or upgrade proof.

Evidence

What I checked:

  • Introduced scope and merge ownership: The pinned introduced delta contains only test files. The verified test merge records the supplied base parent followed by the exact PR head, and its comparison against that base also contains only the test changes; unrelated endpoint drift is not attributed to this PR. (7a1b935e6b3c)
  • Snapshot acquisition and transfer cases retained: The consolidated table retains ordinary acquisition, isolated acquisition, and copy fallback. It checks the single private image, publication receipt, unchanged source, SQLite integrity, preserved row ID, and payload bytes. (src/infra/sqlite-snapshot.transfer.test.ts:111, 7e10f481207c)
  • Audit recovery cases retained: The generation table retains claim-only recovery, interrupted sanitized publication, active sources, and reserved generations. Claim-only recovery checks detection, imported rows, raw archive creation, and removal of the original claim. (src/infra/state-migrations.audit-logs.test.ts:312, 7e10f481207c)
  • Poll eligibility and asynchronous context retained: Unsafe-integer cadence remains an explicit rejected input. The concurrent-target test checks the exact abort signal before and after awaited work, independent private dispositions, and context cleanup. (src/infra/session-event-wake.poll-disposition.test.ts:108, 7e10f481207c)
  • Consolidation remains necessary: Fetched main still has the separate snapshot acquisition cases, and both the snapshot-transfer and audit-migration suites differ from this branch. The related merged update repair, fix(update): accept a re-linked launcher during the swap and keep triage usable without safe mode #164438, addresses launcher recovery rather than this consolidation. (src/infra/sqlite-snapshot.transfer.test.ts:120, a0af795745b6)
  • Validation evidence and its limits: The captured PR body reports 844 passing tests, a 65-test restoration rerun, and a successful changed-file gate. The linked Testbox workflow is cancelled, consistent with the disclosed lease-cleanup qualification; its workflow status alone does not verify the reported remote command result. This read-only review did not execute tests.

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • fuller-stack-dev: 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.

@steipete
steipete merged commit 0b602b0 into main Oct 4, 2026
121 checks passed
@steipete
steipete deleted the tcr/land-d184-1791069879 branch October 4, 2026 00:13
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
…4628)

* test(infra): deslop u0242 tests

* test(workers): deslop u0227 tests

Port shard u0227 while preserving the lane capacity fixture fix already present from de8845f049052aa276c36e9829e8baaa7572f234. Apply the test consolidations from 9b79bc4bbe524e408497a0826a4c8651e6bd35fb.

Validated on Blacksmith Testbox from fresh main 045550c plus the seven resolved test files: 99 tests passed across 7 files, no skips. Focused oxlint, oxfmt, diff checks, and independent review passed.

* test(infra): deslop u0243 tests

* test(gateway): deslop u0230 tests

Port 9ac90ae875b72b33841f216daf5096e15273a11b and 933ab48ef072b29fbc762b488883f2ce2f7c0b9b onto the campaign lane. Preserve the newer tool-presentation fixture and both schema-admission cases from HEAD.

Validation: fresh-main small-delta Testbox checkout, 4 files and 39 tests passed with no skips (33.04s); oxlint, oxfmt --check, and git diff --check passed. Independent review found no actionable issues.

* test(sqlite): deslop u0246 tests

* test(infra): deslop u0231 tests

* test(infra): deslop u0247 tests

* test(infra): deslop u0244 tests

* test(infra): deslop u0248 tests

* test(infra): deslop u0241 tests

* test(infra): retain distinct boundary cases after consolidation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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