Repository navigation
fix(workboard): lifecycle timer test races with database reads - #148221
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. Reviewed September 14, 2026, 8:42 AM ET / 12:42 UTC (Revision 2). ClawSweeper reviewWhat this changesThe Workboard lifecycle test waits for each complete reconciliation sweep before checking card status or advancing its fake clock. Merge readiness✅ Ready for maintainer review Keep open: this is a focused, useful repair to a timer test that still races on current main. No actionable patch defect was found, and the earlier merged fixture repair does not cover this interval case. Priority: P3 Review scores
Verification
How this fits togetherWorkboard’s Gateway service reconciles linked session activity into persisted card status and schedules another sweep after completion. This test exercises that service with a real SQLite worker and controlled session responses. flowchart TD
A[Gateway startup] --> B[Lifecycle reconciliation]
C[Session snapshot] --> B
B --> D[SQLite card updates and final reads]
D --> E[Completed sweep]
E --> F[Next 60-second timer]
E --> G[Test status assertions]
F --> B
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +5. Total +5 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the existing lifecycle owner and synchronize the interval test with its complete admitted operation, preserving timing and observable status assertions. Do we have a high-confidence way to reproduce the issue? Yes at the source-ordering level: a persisted running status can precede the final database read and timeout registration. No deterministic failing execution was established in this read-only review, and the author explicitly reports that the original local case passed. Is this the best way to solve the issue? Yes. Awaiting the existing operation promise removes the premature clock advance without adding production seams, retries, longer timeouts, or weaker assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3a2101a0fc2a. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
Related: #147950, #146976, #148102
What Problem This Solves
Fixes intermittent Workboard lifecycle timer test failures when the first card status becomes visible before its background reconciliation sweep finishes. This is a maintainer-requested follow-up to the failure observed in #148102 CI.
User Impact
No user-visible behavior changes. The existing recurring reconciliation test stops depending on SQLite worker scheduling.
Why This Change Was Made
The service arms its next timeout after the complete admitted sweep, including its final database reads. Waiting only for the first persisted
runningstatus can advance the fake clock before that timeout exists. The test now awaits each outerrunOperationpromise, following the completion pattern established in #147950, while retaining the 60-second interval,runningthenreviewassertions, and exactly two session reads.Evidence
ba7d1f8051fdec1dac343d399408c16473b6d6a1.git diff --checkpassed.No production code, timeout, retry policy, or line-budget exception changed.