Commit 4c79ebf
Pin available_at filter cutoff to microsecond precision in drainReadyTasks
The drainReadyTasks helpers added in d042ea9 (V2WorkflowTest) and b5ce150
(V2RunDetailViewTest) bound a Carbon now() instance to the available_at
SQL filter. Eloquent serialized the Carbon to second precision before
binding, so the comparison `available_at <= now()` returned false when
the row was created within the same wall-clock second as the filter
(microseconds 597278 > seconds-only 0).
Symptom: drainReadyTasks would skip the freshly-dispatched workflow start
task because its available_at (set to now() during dispatch) was bound as
a microsecond timestamp in the column but compared against a truncated
filter value, leaving the workflow stuck at status=pending.
Fix the filter to format the cutoff with microsecond precision via
`now()->format('Y-m-d H:i:s.u')` so the bound parameter and the stored
column compare consistently on both MySQL and PostgreSQL.
Clears the latent failure in any drainReadyTasks-driven test where the
start task fires within the same wall-clock second as the drain. Verified
locally with Postgres: testWorkflowActivityHeartbeatPersistsAttemptMetadata
and the seven d042ea9 timer-cancel tests now pass; the six b5ce150
RunDetailView conversions also still pass under the new filter shape.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 2a90654 commit 4c79ebf
2 files changed
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3823 | 3823 | | |
3824 | 3824 | | |
3825 | 3825 | | |
| 3826 | + | |
| 3827 | + | |
| 3828 | + | |
3826 | 3829 | | |
3827 | 3830 | | |
3828 | 3831 | | |
3829 | | - | |
| 3832 | + | |
3830 | 3833 | | |
3831 | | - | |
| 3834 | + | |
3832 | 3835 | | |
3833 | 3836 | | |
3834 | 3837 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8115 | 8115 | | |
8116 | 8116 | | |
8117 | 8117 | | |
| 8118 | + | |
| 8119 | + | |
| 8120 | + | |
8118 | 8121 | | |
8119 | 8122 | | |
8120 | 8123 | | |
8121 | | - | |
| 8124 | + | |
8122 | 8125 | | |
8123 | | - | |
| 8126 | + | |
8124 | 8127 | | |
8125 | 8128 | | |
8126 | 8129 | | |
| |||
0 commit comments