Skip to content

fix(test): await the cron scheduler child's exit instead of a wall-clock kill - #155278

Merged
steipete merged 1 commit into
mainfrom
upd/cron-shared-store-child-signal
Sep 21, 2026
Merged

steipete merged 1 commit into
mainfrom
upd/cron-shared-store-child-signal

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #153167

What Problem This Solves

Fixes cron shared-store CI failures when slow scheduler-child startup or completion reaches the fixture's 60-second kill deadline. The failures appeared in run 35659161173 / job 106530444451.

User Impact

No production behavior change. The tests continue to verify cross-process runtime writes, receipt identity, and successor recovery without treating fixture delay as a scheduler crash.

Why This Change Was Made

Reuse the existing compiled cron fixture graph, await each child's recorded close, and report its exit code, signal, stderr, and elapsed time. A shared cleanup hook joins children before releasing their stores. The successor test still requires actual process death, and the direct persisted-state assertions and existing 90-second test budgets remain intact.

The original helper's spawnSync and overlapping spawn both had independent 60-second deadlines. A deterministic 61-second completion hold reproduced ETIMEDOUT, SIGTERM, and null exit status at 60.091 seconds with empty stderr. The patched helper passed that same hold in 63.289 seconds. The original hosted log omitted the signal; its three failures occurred at 62.694, 60.623, and 60.156 seconds.

Evidence

Five independent contended Testbox replays passed 125 files / 1,561 tests each. Times below are seconds.

Run Full shard wall Delayed completion Receipt identity Successor recovery
1 394.320 64.959 2.352 4.128
2 599.252 65.708 3.610 5.077
3 411.152 65.124 2.793 4.288
4 370.277 64.433 2.468 3.999
5 458.157 64.378 2.641 4.872

Provider: blacksmith-testbox. Lease IDs: tbx_01m3339zn0m5dx00r6yew00d9g, tbx_01m333ay6hred5fs9a30hrxz4c, tbx_01m333bmm8ja7jsrh1177ej9z3, tbx_01m333bme2vwe5wzx6exwhz3rg, tbx_01m333bmdq3sggmpmct87g6ay8. The Crabbox command results are exit 0; lease workflow status can change during cleanup.

The five runs use the original 125-file shard inventory through the native shard runner, Node 24.19.0, Vitest 5.0.0, two effective Vitest workers, and four CPU-busy processes per Testbox. Each run injects a 61-second hold after the first real cron.run returns, within the existing cannot overwrite runtime committed by a scheduler process case. The receipt-identity and successor cases are unchanged. The delay is proof-only; no sleep is added to committed tests. The leases expose four CPUs; the original hosted log reported eight. Exact concurrent file-start order was not recorded, so the original inventory and native sequencing are preserved.

  • Normal target file: 5/5 tests passed; 5.258 seconds test time, 21.369 seconds command wall time. Shared worker preparation was 9.769 seconds. Command: node scripts/run-vitest.mjs --config test/vitest/vitest.cron.config.ts src/cron/service/shared-store-runtime.test.ts --maxWorkers=1.
  • check:changed passed on Testbox tbx_01m333bmehn24f8ppe4f9cw30x: all 25 core-test typecheck shards, static guards/dead-export scans, and changed-file lint (0 warnings, 0 errors); command exit 0.
  • Fresh Codex P1 autoreview: scoped-clean, no accepted/actionable P0/P1 findings.
  • Production LOC: +0/-0. Tests and test support: +64/-62 across two files.

Named follow-up — warm database fixtures in ops.test.ts: contended replays completed its 71 tests in 128.448–138.341 seconds of test time. withStateDirForStorePath and the task-registry reset repeatedly close/reopen database resources across about 28 isolated scopes. Amortize those boots while preserving task-row isolation, repeated IDs/timestamps, global task lookups, and the separate schema-repair case. This test-performance work is a follow-up, not a gate for this fix.

…ock kill

Reuse the compiled cron fixture and join scheduler children before store cleanup.
Preserve cross-process receipt/recovery assertions and expose exit signals.

Related: #153167
Evidence: CI run 35659161173 / job 106530444451; five contended full-shard
replays plus a 61-second completion-delay probe; check:changed and P1 review.
@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 in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Sep 21, 2026
@steipete
steipete marked this pull request as ready for review September 21, 2026 23:42
@steipete
steipete enabled auto-merge (squash) September 21, 2026 23:45
@steipete
steipete merged commit 67e7e70 into main Sep 21, 2026
159 checks passed
@steipete
steipete deleted the upd/cron-shared-store-child-signal branch September 21, 2026 23:55
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 22, 2026
…ock kill (openclaw#155278)

Reuse the compiled cron fixture and join scheduler children before store cleanup.
Preserve cross-process receipt/recovery assertions and expose exit signals.

Related: openclaw#153167
Evidence: CI run 35659161173 / job 106530444451; five contended full-shard
replays plus a 61-second completion-delay probe; check:changed and P1 review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant