Repository navigation
fix(test): cron Gateway fixture conflicts with database custody - #165457
Conversation
Stop and join the disabled Gateway before an offline scheduler opens the same database, then reconnect for the API mutation. The stale in-memory service contract retains its existing dedicated regression. Preserve production authority rules, all assertions, and timeouts. Co-authored-by: steipete <[email protected]>
|
🦞👀 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. Reviewed October 5, 2026, 4:52 AM ET / 08:52 UTC. ClawSweeper reviewWhat this changesThe cron Gateway test stops its client and Gateway before an offline scheduler uses the database, then restarts and reconnects for the API edit. Merge readiness✅ Ready for maintainer review The fixture repair remains necessary on current main. The custody handoff preserves the persistence assertions, and no actionable patch defect was found. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw's cron service stores scheduled jobs and execution state in its database. This fixture exercises an offline scheduler followed by a Gateway API edit to verify that the saved execution state survives. flowchart TD
A[Gateway creates jobs] --> B[Client and Gateway stop]
B --> C[Offline scheduler runs job]
C --> D[Execution state saved]
D --> E[Gateway restarts]
E --> F[API edits another job]
F --> G[Verify execution state preserved]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +6. Total +6 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep exclusive production database custody and exercise scheduler-to-Gateway persistence through the existing fixture lifecycle. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the conflicting sequence: a live Gateway has mutated cron jobs before another process acquires the same exclusive cron custody. The PR reports baseline reproduction; this review did not execute it. Is this the best way to solve the issue? Yes, the existing stop/restart lifecycle is the narrow repair, and dedicated shared-store coverage preserves the stale-snapshot contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7fce6261cefd. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash auto-merge.
|
…5457) Stop and join the disabled Gateway before an offline scheduler opens the same database, then reconnect for the API mutation. The stale in-memory service contract retains its existing dedicated regression. Preserve production authority rules, all assertions, and timeouts. Co-authored-by: steipete <[email protected]>
What Problem This Solves
Fixes the cron multi-Gateway E2E failure when an offline scheduler tries to open a database still owned by a scheduler-disabled Gateway.
User Impact
No user-visible runtime change. The fixture now respects existing exclusive database custody while continuing to verify that a Gateway edit preserves persisted scheduler runtime.
Why This Change Was Made
Disabling scheduling does not release the Gateway's cron mutation authority. Stop and join its client and process before starting the offline scheduler, then restart and reconnect before the API edit. All original assertions and timeouts remain unchanged. The existing shared-store regression still covers stale in-memory service snapshots.
This inherited failure reproduced with both baseline and updated dependencies. A direct-main repair push in this task was rejected by the repository's PR-only ruleset, so this uses the required focused PR fallback. Only the fixture changes; no production, dependency, or database-policy changes.
Evidence
git diff --checkpass.Contributor credit
Requested by Peter Steinberger (@steipete).
Work sessions