Skip to content

test: stabilize flaky fixtures (batch f036) - #159046

Merged
steipete merged 8 commits into
mainfrom
tcr/land-f036-1790438699
Sep 26, 2026
Merged

steipete merged 8 commits into
mainfrom
tcr/land-f036-1790438699

Conversation

@steipete

@steipete steipete commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes intermittent test failures caused by cold plugin discovery, process startup races, and fixture work outliving its test in campaign batch f036.

User Impact

Developer validation becomes more deterministic. Runtime production behavior, test assertions, and coverage cases are preserved.

Why This Change Was Made

Align the webchat fixture registry with its disabled-plugin config; own and join Slack dispatches and drive startup-auth timeouts from real request/socket events; wait for the mock provider's bound-port announcement; scope Doctor's real plugin discovery; prepare CLI broadcast artifacts; and join Android qualification and SCP process trees under their test lifetimes.

Replay notes against main 7b93d64b27a6701ed2935197cecf7f3bbfe9481f:

  • Applied seven source commits: 09f0e33d4569, d548a1a0099f, dac3f47701c5, 88814f80ab22, f1a41115db83, 6d39296169c4, and bcf05c4edc68, preserving their messages.
  • Skipped ee1967c4ade6: terminal Anthropic catalog publication is already fixed by 0ac0de35dd49ad769837bbc77a70c100a5e7ec0c (fix(anthropic): stabilize session catalog watcher arming #154164), including stronger deferred-work cleanup.
  • Gateway conflicts retain main's test cancellation, native process-closure verification, backing-state retention case, and stream assertions. Only registry setup and provider readiness change.
  • Slack preserves module-local mocks, async database reset/drain, explicit plugin registry, receipt-aware sends, and current recovery assertions. The stalled server enhancement follows its current helper. Dropped the obsolete singleton/config-disable rewrite because main already scopes plugin discovery; consolidated the existing startup latch.
  • Doctor retains its shared worker scope, settlement diagnostics, and update-parent capability flag. Dropped the obsolete checkpoint mock comment; main removed that mock.
  • CLI retains the broadcast stabilization and its message-owned prepared finalizer; the compiler resolver follows main's filtered-hook API. Dropped the startup-only full-build/default-entrypoint hunks after CI showed they push the existing runtime cohort to 151 predicted seconds against its 150-second bound. Main's startup fixture behavior, test cases, planner policy, and bounds remain unchanged. Doctor runtime ownership expectations include its new prerequisite.
  • Android retains all qualification cases and assertions and adds the three current helper imports that its campaign parent already supplied. SCP import conflicts preserve newer attachment coverage.

No changed path matches the current CODEOWNERS rules.

Evidence

  • Frozen dependency install, targeted oxfmt, plain oxlint across all changed TypeScript/tooling files, and git diff --check passed.
  • The check-changed dry run selected core/extension/script/root-test typechecks and relevant guard/lint lanes.
  • Testbox infrastructure gap: the focused-test invocation stayed in local source-capsule preparation for over 30 minutes without reaching remote test execution. It was interrupted. The separately delegated changed-file gate reached the same preparation phase and was interrupted too; its wrapper reported EPROCESSGROUP_CLEANUP_FAILED during cancellation. Neither attempt produced a test or typecheck result. These are unexecuted validation gates, not passing proof.
  • Focused selection requested every touched test file plus prepared-worker and build-admission owner tests. The intended proof includes real mock-provider HTTP readiness, Slack transport socket closure, CLI output drainage, Android qualification, and SCP process cancellation.
  • Independent P2 review of the seven-commit candidate passed with no actionable findings. A separate review covers the bounded CI correction. Initial hosted run 36257908718 exposed two stale Doctor ownership expectations and four CLI runtime prediction assertions; the correction updates the ownership contract and drops the startup hunk. GitHub's required openclaw/ci-gate remains the merge gate under the campaign's infrastructure-gap policy.
  • LOC split: runtime production +0/-0; test-build tooling +34/-0; tests/test support +679/-369; docs +3/-0. No test cases or behavioral assertions were removed.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: slack Channel integration: slack gateway Gateway runtime cli CLI command changes scripts Repository scripts commands Command implementations size: XL labels Sep 26, 2026
@steipete
steipete enabled auto-merge (squash) September 26, 2026 17:09
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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:22 PM ET / 18:22 UTC (Revision 3).

ClawSweeper review

What this changes

The branch changes Slack, Gateway, Doctor, CLI, SCP, and Android test fixtures to coordinate readiness and process cleanup, and prepares CLI worker artifacts used by those tests.

Merge readiness

✅ Ready for maintainer review

Current main still contains the fixture races this PR addresses. The branch remains a coherent test-stability change, and source review found no discrete introduced defect. Its exact-head validation is still pending.

Priority: P2
Reviewed head: 2af19e01a000c5781dce5eeb61f92b7aa81c82f6

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The fixture changes are coherent and source review found no defect, but exact-head focused execution remains unverified.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate. Its changed owners are test fixtures and worker preparation; the submitted focused run never reached execution, so no exact-head after-fix result is claimed. 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 maintainer-authored PR is exempt from the external-contributor proof gate. Its changed owners are test fixtures and worker preparation; the submitted focused run never reached execution, so no exact-head after-fix result is claimed. No stored-data contract changes.
Evidence reviewed 7 items Introduced fixture changes: The pinned merge-base-to-head diff changes test fixtures, test support, worker-build tooling, and test documentation; it does not change application runtime production files.
Gateway readiness change remains useful: Current main still reserves a port before starting the mock provider. The PR instead waits for the provider's bound-port announcement, then retains the health check.
Slack fixture lifecycle: The changed helper tracks dispatch promises and aborts and joins them before shared fixture state is reset; the stalled-auth test waits on real request and socket-close events.
Findings None None.
Security None None.

How this fits together

OpenClaw's test tooling prepares runtime artifacts before test workers start. The affected fixtures then exercise channel, Gateway, CLI, and release paths and feed their results into CI.

flowchart LR
A[CI test selection] --> B[Prepared worker artifacts]
B --> C[Test fixture setup]
C --> D{Ready and owned?}
D --> E[Channel and process scenarios]
E --> F[Test results]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +313, Other +34. Total +347 across 15 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 12 684 371 +313
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 34 0 +34
Total 15 718 371 +347

Review metrics

Metric Value Why it matters
Runtime versus test growth runtime +0/-0; test tooling +34/-0; tests and support +681/-371 The added code serves fixture ownership and artifact preparation without growing application runtime code.

Technical review

Best possible solution:

Retain the fixture-owned readiness and cleanup changes, and use the normal exact-head CI gate to verify that the existing assertions execute successfully.

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

No high-confidence final-head reproduction was recorded: the PR describes intermittent failures, but its focused Testbox attempt did not reach test execution. Source inspection shows the Gateway port race and fixture lifetime paths.

Is this the best way to solve the issue?

Yes, provisionally. The changes synchronize on fixture-owned readiness and join child work while preserving the existing assertions; exact-head execution is still needed to verify the result.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 31445e843ad8.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Intermittent validation failures affect developer confidence, with limited direct user impact.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp 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 is exempt from the external-contributor proof gate. Its changed owners are test fixtures and worker preparation; the submitted focused run never reached execution, so no exact-head after-fix result is claimed. No stored-data contract changes.

Evidence

What I checked:

  • Introduced fixture changes: The pinned merge-base-to-head diff changes test fixtures, test support, worker-build tooling, and test documentation; it does not change application runtime production files. (scripts/lib/vitest-worker-compiler.mts:179, 2af19e01a000)
  • Gateway readiness change remains useful: Current main still reserves a port before starting the mock provider. The PR instead waits for the provider's bound-port announcement, then retains the health check. (src/gateway/gateway-concurrent-streams.test.ts:338, 31445e843ad8)
  • Slack fixture lifecycle: The changed helper tracks dispatch promises and aborts and joins them before shared fixture state is reset; the stalled-auth test waits on real request and socket-close events. (extensions/slack/src/monitor.test-helpers.ts:174, 2af19e01a000)
  • Prepared CLI command boundary: The CLI helper dynamically imports the message command. The new worker-build resolver preserves a separate command module so the broadcast fixture can substitute it. (src/cli/program/message/helpers.ts:211, 2af19e01a000)
  • Current main and related work: Main's changes since the pinned PR base touch update documentation and update runtime files, not the PR's fixture paths. The merged Anthropic catalog repair at fix(anthropic): stabilize session catalog watcher arming #154164 addresses separate watcher and fixture behavior that this branch says it deliberately omitted. (31445e843ad8)
  • Validation and prior review: The PR body reports that focused Testbox and changed-file attempts stopped during source-capsule preparation before tests or typechecks ran. Two prior ClawSweeper cycles reported no findings; the retained rank-up request for results and wall time was conditional on exact-head execution becoming available. Exact-head CI was pending in the supplied snapshot. (2af19e01a000)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Ayaan Zaidi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Josh Avant: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • If exact-head execution becomes available, record the focused fixture results and measured per-file wall time.

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 (2 earlier review cycles)
  • reviewed 2026-09-26T17:13:05.746Z sha dd85926 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-26T17:42:05.557Z sha 8e19a414bdfcc2ae37710f6cffbfa0a477c97760 :: needs maintainer review before merge. :: none

@steipete
steipete disabled auto-merge September 26, 2026 17:25
@steipete
steipete enabled auto-merge (squash) September 26, 2026 17:36
@steipete
steipete disabled auto-merge September 26, 2026 18:15
Align the webchat fixture's runtime registry with its disabled-plugin config.
Shared channel stubs otherwise load bundled message adapters during tool
resolution, delaying the test deadline and letting stale teardown interrupt
the following case.

Proof: both reported cases passed 10 isolated runs; the complete 13-case file
passed twice. Formatting, typechecking, targeted lint, and P2 autoreview
passed. check-changed hit only Knip ETIMEDOUT on both permitted attempts.
Align supplied and ambient fixture config to avoid cold bundled-plugin discovery. Own and join dispatch work before resetting shared state, and wait on Bolt readiness events. Control the stalled-auth deadline through real request and socket-close events, with cancellation-aware cleanup and fixture-owned database setup.
Wait for the existing bound-port announcement on an OS-assigned port instead of racing the implicit one-second startup poll. Preserve the real health check, cancellation, cleanup, and stream assertions. The final full-shard run passes both streams and global run observation.
Scope real plugin discovery to each fixture and prepare the compiled Discord package needed by config migration coverage. Keep cold unrelated plugin imports outside the existing test deadlines.
Keep the broadcast fixture stabilization but drop the startup-only build prerequisite that pushes the retained CLI runtime cohort beyond its existing prediction bound. Preserve main startup behavior and all bounds. Include Doctor preflight in its exact runtime ownership expectations.
@steipete
steipete force-pushed the tcr/land-f036-1790438699 branch from 8e19a41 to 2af19e0 Compare September 26, 2026 18:15
@steipete
steipete enabled auto-merge (squash) September 26, 2026 18:17
@steipete
steipete merged commit 12bc123 into main Sep 26, 2026
190 checks passed
@steipete
steipete deleted the tcr/land-f036-1790438699 branch September 26, 2026 18:33
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 27, 2026
* test(gateway): stabilize CLI question authority fixtures

Align the webchat fixture's runtime registry with its disabled-plugin config.
Shared channel stubs otherwise load bundled message adapters during tool
resolution, delaying the test deadline and letting stale teardown interrupt
the following case.

Proof: both reported cases passed 10 isolated runs; the complete 13-case file
passed twice. Formatting, typechecking, targeted lint, and P2 autoreview
passed. check-changed hit only Knip ETIMEDOUT on both permitted attempts.

* test(slack): stabilize auth monitor fixtures

Align supplied and ambient fixture config to avoid cold bundled-plugin discovery. Own and join dispatch work before resetting shared state, and wait on Bolt readiness events. Control the stalled-auth deadline through real request and socket-close events, with cancellation-aware cleanup and fixture-owned database setup.

* test(gateway): stabilize mock provider readiness

Wait for the existing bound-port announcement on an OS-assigned port instead of racing the implicit one-second startup poll. Preserve the real health check, cancellation, cleanup, and stream assertions. The final full-shard run passes both streams and global run observation.

* test(commands): stabilize doctor preflight fixtures

Scope real plugin discovery to each fixture and prepare the compiled Discord package needed by config migration coverage. Keep cold unrelated plugin imports outside the existing test deadlines.

* test(cli): stabilize startup and broadcast fixtures

* test(scripts): stabilize Android qualification fixture

* test(auto-reply): stabilize SCP cancellation fixture

* test: preserve existing CLI runtime shard budget

Keep the broadcast fixture stabilization but drop the startup-only build prerequisite that pushes the retained CLI runtime cohort beyond its existing prediction bound. Preserve main startup behavior and all bounds. Include Doctor preflight in its exact runtime ownership expectations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: slack Channel integration: slack cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts 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