Skip to content

fix(ci): avoid premature database verifier test timeouts - #158171

Merged
steipete merged 1 commit into
mainfrom
codex/fix-db-exit818
Sep 25, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-db-exit818

Conversation

@steipete

@steipete steipete commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes intermittent database-verifier test failures when a real child process takes more than one second to exit on a busy CI runner.

User Impact

No user-visible or production behavior changes. The lifecycle tests still require native process exit and IPC disconnection before verification and Stop finish.

Why This Change Was Made

Three tests polled child state with Vitest's one-second default before reaching their intended lifecycle assertions. They now subscribe to the child's exit event before it can fire. The held-disconnect test also observes that notification directly, gives premature promise completion an event-loop turn to surface, and releases and joins its child in finally. Spawn-failure coverage still uses the separate close-only contract.

Evidence

  • Original failure: manual CI run, small-14, openclaw-database-verify.process.test.ts:278; the child had not exited before vi.waitFor expired, so the pending-disconnect assertion was never reached.
  • Original 16-file shard order replay: 448 passed, 8 skipped in 247.581 seconds. It did not reproduce the timing failure; this passing replay alone is not claimed as a fix.
  • Final process test file: 27 passed; pnpm test src/state/openclaw-database-verify.process.test.ts --maxWorkers=1 wall time 22.087 seconds (Vitest 19.82 seconds). The three repaired cases took 7, 135, and 125 milliseconds locally.
  • A temporary negative control removing the production disconnect-join requirement failed at the intended premature-completion assertion. Production source was restored byte-for-byte before final proof.
  • Fresh independent review found no actionable P0–P2 issue. Selected changed checks passed all 20 other gates; their first lint run caught an implicit Promise-executor return in the new observer. That was corrected to a block body, with targeted lint and final review repeated.
  • Exact-head hosted CI passed. The selected Node job ran all 27 process tests successfully: 40.22 seconds Vitest time (41.81 seconds runner wall time; 83 seconds for the full job). The three repaired cases took 5, 132, and 149 milliseconds; 95% of file time was transformation. Hosted review found no actionable issues.

@steipete steipete self-assigned this Sep 25, 2026
@clawsweeper

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

@steipete
steipete marked this pull request as ready for review September 25, 2026 14:46
@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 25, 2026
@clawsweeper

clawsweeper Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 25, 2026, 10:53 AM ET / 14:53 UTC.

ClawSweeper review

What this changes

The branch changes database-verifier process tests to observe child exit and IPC disconnect events instead of polling child state with Vitest’s one-second default.

Merge readiness

✅ Ready for maintainer review

Keep open. Current main still contains the one-second waits implicated in the reported CI failure, and this focused PR preserves the verifier’s lifecycle assertions. I found no actionable introduced defect.

Priority: P2
Reviewed head: 25dbc25d063e61005069f9f4436e0dec8641ee51

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused test repair is supported by reported real-process validation, with hosted timing still pending.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The contributor proof gate does not apply to this member-authored, test-only PR. Its body reports a passing run through the real forked verifier process and a temporary negative control; the intermittent hosted timing result remains for exact-head CI. 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 contributor proof gate does not apply to this member-authored, test-only PR. Its body reports a passing run through the real forked verifier process and a temporary negative control; the intermittent hosted timing result remains for exact-head CI. No stored-data contract changes.
Evidence reviewed 6 items Introduced test change: The pinned merge-base-to-head diff changes only the process test file. The tests subscribe to native exit before the child can exit and directly observe the held disconnect notification.
Production lifecycle contract: The verifier’s owned lifecycle settles only after both native exit and IPC disconnect; the process tests exercise that same owner.
Current-main necessity: The pinned current-main version still uses one-second vi.waitFor polling in the affected lifecycle tests. The verified test merge changes this file alone.
Findings None None.
Security None None.

How this fits together

The Gateway runs database integrity checks in a child process to protect its SQLite locks. Verification and shutdown complete after that child exits and its IPC channel disconnects.

flowchart LR
  A[Gateway integrity check] --> B[Verifier child process]
  B --> C[SQLite check results]
  B --> D[Native exit event]
  B --> E[IPC disconnect event]
  D --> F[Lifecycle completion]
  E --> F
  F --> G[Verification and Stop finish]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +20. Total +20 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 43 23 +20
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 43 23 +20

Review metrics

Metric Value Why it matters
Process test cost 22.087 s wall; 19.82 s Vitest The reported single-worker measurement makes the cost of this real-process test file visible against the repository’s test budget.

Technical review

Best possible solution:

Keep the event-driven process tests at the verifier lifecycle boundary and let the exact-head CI run confirm they remain reliable on hosted runners.

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

No high-confidence replay of the intermittent timeout was established in this read-only review. Current-main source shows the one-second polling mechanism, and the PR links an original CI failure.

Is this the best way to solve the issue?

Yes. Waiting on events emitted by the real child process addresses the test timeout at its observation boundary while retaining exit and disconnect assertions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 09388042b047.

Labels

Label changes:

  • add P2: Intermittent verifier-test timeouts impede CI reliability, with no reported production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 contributor proof gate does not apply to this member-authored, test-only PR. Its body reports a passing run through the real forked verifier process and a temporary negative control; the intermittent hosted timing result remains for exact-head CI. No stored-data contract changes.

Label justifications:

  • P2: Intermittent verifier-test timeouts impede CI reliability, with no reported production behavior 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 contributor proof gate does not apply to this member-authored, test-only PR. Its body reports a passing run through the real forked verifier process and a temporary negative control; the intermittent hosted timing result remains for exact-head CI. No stored-data contract changes.

Evidence

What I checked:

  • Introduced test change: The pinned merge-base-to-head diff changes only the process test file. The tests subscribe to native exit before the child can exit and directly observe the held disconnect notification. (src/state/openclaw-database-verify.process.test.ts:111, 25dbc25d063e)
  • Production lifecycle contract: The verifier’s owned lifecycle settles only after both native exit and IPC disconnect; the process tests exercise that same owner. (src/state/openclaw-database-verify.impl.ts:49, 25dbc25d063e)
  • Current-main necessity: The pinned current-main version still uses one-second vi.waitFor polling in the affected lifecycle tests. The verified test merge changes this file alone. (src/state/openclaw-database-verify.process.test.ts:153, 09388042b047)
  • Reported validation: The PR body links the original CI failure and reports 27 passing process tests, a 22.087-second single-worker wall time, and a temporary negative control. The original shard replay passed before the fix and is not evidence that the intermittent failure was eliminated.
  • Area history: Recent merged history of the verifier implementation and process tests identifies prior lifecycle and SQLite-verifier work by Peter Steinberger. Line-level introduction was not established because the partial checkout could not retrieve older parent blobs. (src/state/openclaw-database-verify.impl.ts, 569750c79d04)
  • Release check: No release tag contains the proposed PR head; the change remains an open, unmerged test repair. (25dbc25d063e)

Likely related people:

  • steipete: 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 enabled auto-merge (squash) September 25, 2026 14:59
@steipete
steipete merged commit 53a0b85 into main Sep 25, 2026
165 of 166 checks passed
@steipete
steipete deleted the codex/fix-db-exit818 branch September 25, 2026 15:00
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

vincentkoc added a commit that referenced this pull request Sep 25, 2026
* commit '54b5f23b006ae917c8bb7903f5ee7dad6108ec25': (194 commits)
  feat(ui): listen to managed desktop audio in the panel (#157724)
  fix(ci): resume partially published preparation receipts (#158174)
  feat(release): one approval per release via an attested parent approval receipt (#157911)
  feat(desktop): advertise current managed desktop audio (#157723)
  fix(ui): retain delayed progress scroll gestures (#158153)
  refactor(ui): share sidebar mutation error feedback (#158173)
  test: await database verifier process lifecycle events (#158171)
  perf(update): avoid repeated retained-copy parent creation
  feat(desktop): bind audio streaming to screen authorization (#157722)
  refactor(gateway): split companion prompts and metadata fixtures (#158050)
  feat(desktop): isolate managed Linux application audio (#157720)
  fix(test): prepare catalog fixture modules before startup (#158157)
  fix: keep model pickers usable during provider sign-in (#158132)
  refactor(test): remove unused prompt scenario metadata (#158151)
  fix(ci): unblock Control UI targeted Crabbox gates (#158149)
  refactor(agents): deslop subagents, sessions, worktrees, commands and auth (#158020)
  fix: bound stalled browser stream startup (#156323)
  fix(onnx): prevent worker fixture hangs after release (#158146)
  fix(models): preserve scoped provider discovery outcomes (#158139)
  fix(agents): report offline trash failures after agent delete (#158052)
  ...
vincentkoc added a commit that referenced this pull request Sep 25, 2026
* commit '54b5f23b006ae917c8bb7903f5ee7dad6108ec25': (175 commits)
  feat(ui): listen to managed desktop audio in the panel (#157724)
  fix(ci): resume partially published preparation receipts (#158174)
  feat(release): one approval per release via an attested parent approval receipt (#157911)
  feat(desktop): advertise current managed desktop audio (#157723)
  fix(ui): retain delayed progress scroll gestures (#158153)
  refactor(ui): share sidebar mutation error feedback (#158173)
  test: await database verifier process lifecycle events (#158171)
  perf(update): avoid repeated retained-copy parent creation
  feat(desktop): bind audio streaming to screen authorization (#157722)
  refactor(gateway): split companion prompts and metadata fixtures (#158050)
  feat(desktop): isolate managed Linux application audio (#157720)
  fix(test): prepare catalog fixture modules before startup (#158157)
  fix: keep model pickers usable during provider sign-in (#158132)
  refactor(test): remove unused prompt scenario metadata (#158151)
  fix(ci): unblock Control UI targeted Crabbox gates (#158149)
  refactor(agents): deslop subagents, sessions, worktrees, commands and auth (#158020)
  fix: bound stalled browser stream startup (#156323)
  fix(onnx): prevent worker fixture hangs after release (#158146)
  fix(models): preserve scoped provider discovery outcomes (#158139)
  fix(agents): report offline trash failures after agent delete (#158052)
  ...
vincentkoc added a commit that referenced this pull request Sep 25, 2026
* fix(qa-lab): retain tab focus and scroll during polling

* chore(qa-lab): merge main for tab navigation validation

* fix(qa-lab): keep focused tabs visible after layout changes

* fix(qa-lab): reconcile navigation retention with current app

* chore: refresh main for QA Lab navigation validation

* commit '54b5f23b006ae917c8bb7903f5ee7dad6108ec25': (194 commits)
  feat(ui): listen to managed desktop audio in the panel (#157724)
  fix(ci): resume partially published preparation receipts (#158174)
  feat(release): one approval per release via an attested parent approval receipt (#157911)
  feat(desktop): advertise current managed desktop audio (#157723)
  fix(ui): retain delayed progress scroll gestures (#158153)
  refactor(ui): share sidebar mutation error feedback (#158173)
  test: await database verifier process lifecycle events (#158171)
  perf(update): avoid repeated retained-copy parent creation
  feat(desktop): bind audio streaming to screen authorization (#157722)
  refactor(gateway): split companion prompts and metadata fixtures (#158050)
  feat(desktop): isolate managed Linux application audio (#157720)
  fix(test): prepare catalog fixture modules before startup (#158157)
  fix: keep model pickers usable during provider sign-in (#158132)
  refactor(test): remove unused prompt scenario metadata (#158151)
  fix(ci): unblock Control UI targeted Crabbox gates (#158149)
  refactor(agents): deslop subagents, sessions, worktrees, commands and auth (#158020)
  fix: bound stalled browser stream startup (#156323)
  fix(onnx): prevent worker fixture hangs after release (#158146)
  fix(models): preserve scoped provider discovery outcomes (#158139)
  fix(agents): report offline trash failures after agent delete (#158052)
  ...

Co-authored-by: Vincent Koc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 26, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 26, 2026
)

* fix(qa-lab): retain tab focus and scroll during polling

* chore(qa-lab): merge main for tab navigation validation

* fix(qa-lab): keep focused tabs visible after layout changes

* fix(qa-lab): reconcile navigation retention with current app

* chore: refresh main for QA Lab navigation validation

* commit '0001f441f53712e44b2ca6edf2a6752b8abd6d1d': (194 commits)
  feat(ui): listen to managed desktop audio in the panel (openclaw#157724)
  fix(ci): resume partially published preparation receipts (openclaw#158174)
  feat(release): one approval per release via an attested parent approval receipt (openclaw#157911)
  feat(desktop): advertise current managed desktop audio (openclaw#157723)
  fix(ui): retain delayed progress scroll gestures (openclaw#158153)
  refactor(ui): share sidebar mutation error feedback (openclaw#158173)
  test: await database verifier process lifecycle events (openclaw#158171)
  perf(update): avoid repeated retained-copy parent creation
  feat(desktop): bind audio streaming to screen authorization (openclaw#157722)
  refactor(gateway): split companion prompts and metadata fixtures (openclaw#158050)
  feat(desktop): isolate managed Linux application audio (openclaw#157720)
  fix(test): prepare catalog fixture modules before startup (openclaw#158157)
  fix: keep model pickers usable during provider sign-in (openclaw#158132)
  refactor(test): remove unused prompt scenario metadata (openclaw#158151)
  fix(ci): unblock Control UI targeted Crabbox gates (openclaw#158149)
  refactor(agents): deslop subagents, sessions, worktrees, commands and auth (openclaw#158020)
  fix: bound stalled browser stream startup (openclaw#156323)
  fix(onnx): prevent worker fixture hangs after release (openclaw#158146)
  fix(models): preserve scoped provider discovery outcomes (openclaw#158139)
  fix(agents): report offline trash failures after agent delete (openclaw#158052)
  ...

Co-authored-by: Vincent Koc <[email protected]>
vincentkoc added a commit that referenced this pull request Oct 17, 2026
* fix(ui): release failed avatar response bodies

* test(ui): cover avatar response cancellation in Chromium

* test(ui): assert retained image after avatar failure

* test(ui): preserve window global type in avatar proof

* test(ui): avoid shadowed avatar proof bindings

* chore: refresh main for avatar lifecycle validation

* commit '54b5f23b006ae917c8bb7903f5ee7dad6108ec25': (175 commits)
  feat(ui): listen to managed desktop audio in the panel (#157724)
  fix(ci): resume partially published preparation receipts (#158174)
  feat(release): one approval per release via an attested parent approval receipt (#157911)
  feat(desktop): advertise current managed desktop audio (#157723)
  fix(ui): retain delayed progress scroll gestures (#158153)
  refactor(ui): share sidebar mutation error feedback (#158173)
  test: await database verifier process lifecycle events (#158171)
  perf(update): avoid repeated retained-copy parent creation
  feat(desktop): bind audio streaming to screen authorization (#157722)
  refactor(gateway): split companion prompts and metadata fixtures (#158050)
  feat(desktop): isolate managed Linux application audio (#157720)
  fix(test): prepare catalog fixture modules before startup (#158157)
  fix: keep model pickers usable during provider sign-in (#158132)
  refactor(test): remove unused prompt scenario metadata (#158151)
  fix(ci): unblock Control UI targeted Crabbox gates (#158149)
  refactor(agents): deslop subagents, sessions, worktrees, commands and auth (#158020)
  fix: bound stalled browser stream startup (#156323)
  fix(onnx): prevent worker fixture hangs after release (#158146)
  fix(models): preserve scoped provider discovery outcomes (#158139)
  fix(agents): report offline trash failures after agent delete (#158052)
  ...

* test(ui): wait for settled avatar fallback

* test(ui): wait for control UI before avatar handoff

* fix(ui): preserve avatar cleanup across retry lifecycle updates

Integrate current main while preserving retry exhaustion, auth restoration, and deferred response cleanup. Keep the real-stream test on real timers and drain loader cleanup before restoring shared test state.

* fix(ui): integrate avatar response cleanup with current main

* test(ui): align avatar cleanup proof with current harness

* test(ui): qualify avatar cleanup harness types and formatting

Co-authored-by: Vincent Koc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
* fix(ui): release failed avatar response bodies

* test(ui): cover avatar response cancellation in Chromium

* test(ui): assert retained image after avatar failure

* test(ui): preserve window global type in avatar proof

* test(ui): avoid shadowed avatar proof bindings

* chore: refresh main for avatar lifecycle validation

* commit '0001f441f53712e44b2ca6edf2a6752b8abd6d1d': (175 commits)
  feat(ui): listen to managed desktop audio in the panel (openclaw#157724)
  fix(ci): resume partially published preparation receipts (openclaw#158174)
  feat(release): one approval per release via an attested parent approval receipt (openclaw#157911)
  feat(desktop): advertise current managed desktop audio (openclaw#157723)
  fix(ui): retain delayed progress scroll gestures (openclaw#158153)
  refactor(ui): share sidebar mutation error feedback (openclaw#158173)
  test: await database verifier process lifecycle events (openclaw#158171)
  perf(update): avoid repeated retained-copy parent creation
  feat(desktop): bind audio streaming to screen authorization (openclaw#157722)
  refactor(gateway): split companion prompts and metadata fixtures (openclaw#158050)
  feat(desktop): isolate managed Linux application audio (openclaw#157720)
  fix(test): prepare catalog fixture modules before startup (openclaw#158157)
  fix: keep model pickers usable during provider sign-in (openclaw#158132)
  refactor(test): remove unused prompt scenario metadata (openclaw#158151)
  fix(ci): unblock Control UI targeted Crabbox gates (openclaw#158149)
  refactor(agents): deslop subagents, sessions, worktrees, commands and auth (openclaw#158020)
  fix: bound stalled browser stream startup (openclaw#156323)
  fix(onnx): prevent worker fixture hangs after release (openclaw#158146)
  fix(models): preserve scoped provider discovery outcomes (openclaw#158139)
  fix(agents): report offline trash failures after agent delete (openclaw#158052)
  ...

* test(ui): wait for settled avatar fallback

* test(ui): wait for control UI before avatar handoff

* fix(ui): preserve avatar cleanup across retry lifecycle updates

Integrate current main while preserving retry exhaustion, auth restoration, and deferred response cleanup. Keep the real-stream test on real timers and drain loader cleanup before restoring shared test state.

* fix(ui): integrate avatar response cleanup with current main

* test(ui): align avatar cleanup proof with current harness

* test(ui): qualify avatar cleanup harness types and formatting

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. 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