Skip to content

fix(test): prevent hosted release-check contract timeouts - #154335

Merged
steipete merged 1 commit into
mainfrom
upd/slow-release-check
Sep 21, 2026
Merged

steipete merged 1 commit into
mainfrom
upd/slow-release-check

Conversation

@steipete

@steipete steipete commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Related: #154006 (hosted timeout on head 4375dddb383fc13553c6a9ea1b92472c0764e45b). Maintainer-requested update-reliability repair.

What Problem This Solves

Fixes release-check contract coverage timing out under hosted CI load: one case reached 120,048 ms while checking a tiny prepared package.

User Impact

No user-visible release or update behavior changes. CI keeps the same frozen-target validation coverage with far less subprocess work; deadlines and retry policy are unchanged.

Why This Change Was Made

The sparse fixture was already prepared once, but 16 contract variations each started the full release-check CLI and ran an offline npm tarball inspection. The existing target-aware bootstrap validation now accepts explicit target and package roots and remains the operation called by the real release checker. The matrix checks prepared directories in-process, with distinct target paths to prevent module-cache cross-talk. One sparse import probe and one real CLI/tarball rejection remain.

Coverage retains historical two-/three-file worker contracts, canonical-array precedence, missing current artifacts, malformed paths/arrays, targets without a worker producer, target-owned gateway metadata, and tooling-owned SDK fixture bytes. No configuration, schema, dependency, or installed-updater change.

Evidence

  • Hosted failure: test/scripts/release-check.test.ts, core-tooling-9-hosted-3, job 106191100823: 120,048 ms.
  • Blacksmith Testbox tbx_01m30x1ebkrz5te6yach2nr30n: Node 24.19.0, lease workflow. The touched baseline files match the failing head exactly; comparison base is 894fb140a22246bc1574d5b29fe61e10f77036de.
  • Standalone node scripts/run-vitest.mjs --config test/vitest/vitest.tooling.config.ts test/scripts/release-check.test.ts --maxWorkers=1: 14.886 s → 3.288 s wall. Slow case 12.612 s → 1.623 s sparse boundary plus 0.153 s matrix. All 15 revised tests pass.
  • Baseline profile: sparse preparation 645 ms; 16 CLI startups 8,171 ms total; 16 offline npm inspections 2,417 ms total. The matrix now needs zero CLI starts or npm inspections. The 120 s timeout did not reproduce on the Testbox.
  • Original 31-file order was recovered from the failed job and replayed with a temporary sequencer; production test scheduling is unchanged. Baseline: 933 passed, 3 existing skips, 226.54 s Vitest (release-check 10.827 s). Candidate: 934 passed, the same 3 skips, 201.66 s Vitest (1.635 s sparse boundary + 0.152 s matrix). Wall: 228.551 s → 203.225 s. Release-check total TEST time: 10.877 s → 1.834 s. No individual test exceeded 30 s or file exceeded 120 s TEST time in either completed replay.
  • Owner/sibling tests: node scripts/run-vitest.mjs test/scripts/release-check.test.ts test/scripts/check-cli-bootstrap-imports.test.ts: 2 files, 50 tests passed in 3.650 s wall.
  • node scripts/check-changed.mjs -- scripts/release-check.ts test/scripts/release-check.test.ts passed on the Testbox, including script/test-root typechecks, both targeted lint lanes, formatting, erasability, dead-export scans, and package/architecture guards.
  • Independent Codex P1 autoreview: scoped-clean, no actionable findings. git diff --check passes.
  • Production: +13/−6 lines (net +7); tests: +104/−110 (net −6). No new test support files.

The first temporary order-replay harness used an unsupported sequencer CLI shape and collected no tests; its configuration was corrected before recording ordered proof. PR CI timings are pending at author handoff.

Maintainer review disposition

ClawSweeper reviewed head f616cb3171eaeddfab54537fcdbe89e082ba40ea at 2026-09-21 03:15 UTC (comment 5754918985). It reported no actionable correctness or security findings, no before-merge requirements, and no Rank-up moves; there is nothing to apply or skip. The independent Codex review of record is scoped-clean. Exact-head CI is green per the campaign REST check-runs gate. The recorded Testbox timings show reduced work; they do not establish deterministic elimination of every hosted timeout.

@clawsweeper

clawsweeper Bot commented Sep 21, 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 scripts Repository scripts size: M maintainer Maintainer-authored PR labels Sep 21, 2026
@steipete
steipete marked this pull request as ready for review September 21, 2026 03:03
@steipete
steipete requested a review from a team as a code owner September 21, 2026 03:03
@roboclaw-bot

roboclaw-bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Additional matching occurrence from #154193: CI run 35554785036, job 106196333696 (checks-node-compact-small-45), timed out in test/scripts/release-check.test.ts:74 after 120,000 ms in “loads sparse release tooling and checks the target worker contract.” The 31-file core-tooling-9-hosted-3 cohort otherwise passed 932 tests, with 3 existing skips.

The executed merge used main 894fb140a22246bc1574d5b29fe61e10f77036de. I verified both affected source blobs match this PR’s baseline: release checker d7eda7d12cc9f9d6f7966ef06b21b22120b205c3, test a92ed9d77138618caa147292abd74bcfea5b9924. I also read the extraction and retained sparse-import/real-CLI coverage; no duplicate repair or CI rerun is being started in the UI lane.

The required CI gate on #154193 is awaiting the canonical repair rather than a timeout increase or an unchanged rerun. Its UI checks and current-head review passed.

Failure job: https://github.com/openclaw/openclaw/actions/runs/35554785036/job/106196333696

Update: the runtime-policy repair in #154307 has now landed. I have incorporated that canonical correction into the UI branch and its 14 release-check tests plus 42 UI tests pass. This PR’s matrix-work reduction remains separate; the UI lane is no longer waiting for it or taking over its landing. The original timeout observation above is retained without claiming its precise cause was proved.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 1:09 AM ET / 05:09 UTC (Revision 3).

ClawSweeper review

What this changes

The PR runs release-package contract variations through the existing validator in-process while retaining sparse-tooling import coverage and a real CLI tarball rejection.

Merge readiness

✅ Ready for maintainer review

Keep open: this remains a useful, bounded optimization absent from current main. No introduced correctness or security defect was found; the reported measurements demonstrate reduced work without establishing that every hosted timeout is resolved.

Priority: P2
Reviewed head: 260c7fac6cf402ab576372cd724d6cb75fbc1b45

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused optimization with meaningful retained coverage, useful recorded timings, and no actionable introduced defect.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The external-contributor proof gate does not apply to this member-authored internal repair. Recorded Testbox runs exercise the changed release-check tests and retained CLI rejection; they support reduced work, not a proven cure for the intermittent timeout.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply to this member-authored internal repair. Recorded Testbox runs exercise the changed release-check tests and retained CLI rejection; they support reduced work, not a proven cure for the intermittent timeout.
Evidence reviewed 7 items Introduced production change preserves the CLI owner: The introduced delta extracts existing bootstrap validation and supplies explicit target/package roots. The production caller passes process.cwd(), preserving previous path resolution, validation order, and subsequent SDK/package checks.
Meaningful coverage retained: The retained subprocess rejects a tarball missing the target-declared launcher. The in-process matrix preserves historical worker contracts, canonical-array precedence, missing artifacts, malformed declarations, Gateway metadata, and targets without worker producers. Separate target directories prevent imported-module reuse between cases.
Still distinct from current main: Comparison with fetched main shows the same focused extraction and matrix conversion remain outstanding. Current main retains the repeated CLI executions; its separate Node shutdown-policy correction does not implement this optimization.
Findings None None.
Security None None.

How this fits together

Release checking compares a packaged OpenClaw build with its target source declarations before accepting the package. These tests exercise worker artifacts and Gateway bootstrap metadata for current and historical release targets.

flowchart TD
  A[Target source declarations] --> C[Package bootstrap validator]
  B[Prepared package files] --> C
  D[Release-check CLI and tarball] --> C
  E[In-process contract cases] --> C
  C --> F[Accept valid bootstrap artifacts]
  C --> G[Reject missing or malformed artifacts]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -3, Other +7. Total +4 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 107 110 -3
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 13 6 +7
Total 2 120 116 +4

Review metrics

Metric Value Why it matters
Reported test cost 14.886 s → 3.288 s standalone wall The recorded Testbox comparison supports substantially cheaper coverage without extending the timeout.
Subprocess work 16 matrix CLI/npm inspections → 0; 1 CLI rejection retained Contract variations no longer repeat packaging work, while the production entrypoint remains exercised.

Technical review

Best possible solution:

Keep one production bootstrap validator, exercise its contract matrix cheaply, and retain the real sparse CLI boundary without changing deadlines or retry policy.

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

No deterministic reproduction of the hosted timeout is established: the recorded baseline and candidate replays both passed. Source inspection does confirm the repeated subprocess work being removed.

Is this the best way to solve the issue?

Yes, for reducing test cost: the patch reuses the production validator and preserves a real CLI boundary without weakening validation or increasing deadlines.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded test-efficiency improvement for recurring hosted validation timeouts, with no user-facing runtime change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 external-contributor proof gate does not apply to this member-authored internal repair. Recorded Testbox runs exercise the changed release-check tests and retained CLI rejection; they support reduced work, not a proven cure for the intermittent timeout.

Evidence

What I checked:

  • Introduced production change preserves the CLI owner: The introduced delta extracts existing bootstrap validation and supplies explicit target/package roots. The production caller passes process.cwd(), preserving previous path resolution, validation order, and subsequent SDK/package checks. (scripts/release-check.ts:1440, 260c7fac6cf4)
  • Meaningful coverage retained: The retained subprocess rejects a tarball missing the target-declared launcher. The in-process matrix preserves historical worker contracts, canonical-array precedence, missing artifacts, malformed declarations, Gateway metadata, and targets without worker producers. Separate target directories prevent imported-module reuse between cases. (test/scripts/release-check.test.ts:123, 260c7fac6cf4)
  • Still distinct from current main: Comparison with fetched main shows the same focused extraction and matrix conversion remain outstanding. Current main retains the repeated CLI executions; its separate Node shutdown-policy correction does not implement this optimization. (test/scripts/release-check.test.ts, 65485f6adee9)
  • Latest-release comparison: The supplied latest release, v2026.9.5, retains bootstrap validation inside verifyPackedContents rather than the extracted operation used by this PR. (scripts/release-check.ts:1340, ec9c1a13db89)
  • Reported performance evidence and its limit: The captured PR body reports Node 24.19.0 Testbox wall time falling from 14.886 s to 3.288 s, an original-order 31-file replay passing before and after, and 50 owner/sibling tests passing. It explicitly states the 120-second timeout did not reproduce. These are contributor-recorded results; no tests were executed during this read-only review. The inspected media belong to the related UI work and provide no release-check evidence.
  • Merged history and review continuity: Current-main history identifies prior release-tooling work by Peter Steinberger and Dallin Romney. GitHub commit patches confirm the retained Node runtime-policy correction and frozen-release qualification changes. The previous completed review contains no findings or published rank-up moves. Its older head was unavailable locally, so no patch-identical continuity claim is made. (scripts/release-check.ts, 65485f6adee9)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; 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 (2 earlier review cycles)
  • reviewed 2026-09-21T03:15:10.572Z sha f616cb3 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-21T03:42:40.960Z sha f616cb3 :: needs maintainer review before merge. :: none

Run the frozen target worker and gateway contract matrix against prepared package directories through the existing release-check validator. Retain a sparse tooling import probe and one real CLI tarball rejection, without changing deadlines or retry policy.

Testbox proof: original 31-file order passes before and after; release-check test time falls from 10.877s to 1.834s. Owner/sibling tests (50) and changed-file checks pass. Independent P1 review is clean.
@steipete

Copy link
Copy Markdown
Contributor Author

F52 follow-up: the captured remaining wait is in inspectPackedTarball → execNpm → runReleaseCheckCommand → execFileSync(node, [npm-cli.js, "pack", tarball, "--dry-run", "--json", "--ignore-scripts", "--offline"]). On the matching 2-CPU/8-GB Linux class, the release CLI waited in epoll_pwait while npm's main thread futex-waited for its remaining V8 worker. The parent esbuild service was still responding; no native userspace GC stack was captured.

#154567 removes that unnecessary npm inventory subprocess at the release-check owner by collecting paths and unpacked size during the existing strict tar extraction. It is based on the merged fixture refactor here and preserves the complete worker/gateway matrix and retained real CLI assertion.

Proof: 20/20 paired replays of the full 31-file target shard and 32-file neighbour in the captured order on the same 2-CPU/8-GB class, 20/20 standalone runs at the eight-worker setting, and 115 sibling tests. The baseline captured one timeout in four paired attempts; the new guard fails deterministically on the original npm call. Changed-file checks, type-aware lint with its canary, formatting, diff checks, and P2 autoreview passed. Current-head CI also passed. No timeout increase, retry, or weakened assertion.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 22, 2026
…54335)

Run the frozen target worker and gateway contract matrix against prepared package directories through the existing release-check validator. Retain a sparse tooling import probe and one real CLI tarball rejection, without changing deadlines or retry policy.

Testbox proof: original 31-file order passes before and after; release-check test time falls from 10.877s to 1.834s. Owner/sibling tests (50) and changed-file checks pass. Independent P1 review is clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M 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.

2 participants