Repository navigation
test(postgres): cover interrupted Cron work across Gateway crashes - #195955
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR extends the Gateway crash test to verify recovery of provider-accepted, unfinished Cron work. Example: The provider accepts “Report the unfinished one-shot result.” before the Gateway receives SIGKILL.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it adds useful PostgreSQL process-crash coverage beyond current main, preserves the existing recovery policy, and has no actionable review findings. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe PostgreSQL conformance suite sends authenticated Cron RPCs through CLI-started Gateway processes and checks provider requests, public history, and persisted recovery state. flowchart LR
T[Conformance test] --> G[Gateway process]
G --> P[PostgreSQL state]
G --> H[HTTP provider fixture]
T --> K[SIGKILL owner]
K --> R[Replacement Gateway]
R --> P
R --> V[History and scheduler assertions]
Technical reviewBest possible solution: Retain the focused extension of the existing crash scenario using the current recovery owner and unchanged runtime contracts. Do we have a high-confidence way to reproduce the issue? Source inspection confirms the current-main coverage gap; this test-only PR does not establish a failing production behavior, and no target code was executed during review. Is this the best way to solve the issue? The change uses the smallest existing composition that exercises physical Gateway death, PostgreSQL receipts, public recovery history, and replacement scheduling. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 280e1de139e7. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +105, Other +4. Total +109 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 9, 2026, 7:58 AM ET / 12:58 UTC. |
|
Merged via squash.
|
…penclaw#195955) * test(postgres): cover interrupted Cron work across Gateway crashes * test(postgres): bind private Cron receipts through persisted state * test(postgres): omit the default deferred type argument
Related: #195748
What Problem This Solves
The physical PostgreSQL Gateway crash test covers completed retained Cron jobs but misses a provider-accepted run that has not finished when the Gateway dies.
User Impact
Adds regression proof for the existing restart behavior: retain one visible interrupted outcome with its acknowledged public run ID, disable the uncertain overdue one-shot, and do not replay its payload. Runtime behavior, SQLite schemas/versions, recovery formats, config, and recovery policy are unchanged.
Why This Change Was Made
Extend the existing SIGKILL case with one held provider response and verify its running receipt before killing the actual Gateway owner. Public RPCs intentionally hide scheduler-private fields; join receipts to persisted job state on both store and job keys to prove receipt identity and recovery cleanup. Reuse the same restart and automatic-scheduler probe. Public history and physical PostgreSQL rows each require exactly one interrupted outcome with the original public run ID. Only the first unfinished response is held, so a duplicate can finish and fail counts without starving the probe. The 90-second deadline and cleanup stay unchanged.
Evidence
fe6cab218a9fb6e98556825399ddf6c2353394a2: focused physical proof passed on PostgreSQL 16.15 (24.429s), 17.11 (20.681s), and 18.6 (24.861s). One selected case passed per version; six unchanged cases were intentionally skipped per version. All three task containers were removed.fsyncandsynchronous_commitwereonfor every server. The SQLite anchor stays unchanged across restart.5e59b66463dde4718b878e31c4f3afd0fc65bf98of the complete branch against518e8a7d43f32499276f8b60526f2e0b54e150fd: scoped-clean, no actionable findings. Public projection, recovery and row-codec owner source was supplied intact to the reviewer.createDeferred<void>(). Head5e59b66463dde4718b878e31c4f3afd0fc65bf98removes only<void>; the helper defaults tovoid, so runtime proof above is reused. The exact focused type-aware Oxlint path now passes.5e59b66463dde4718b878e31c4f3afd0fc65bf98: all three full PG17 conformance shards, the PG16 Gateway suite, and all other selected jobs passed (24 successful jobs; planned skips are not counted as passes).Production LOC delta: 0. Tests: +107/-2 (net +105), extending the existing case without a new test, fixture, boot or runtime hook.