Commit 1839e7e
Block background TaskWatchdog from racing testActivityRetriesBeforeResumingWorkflow
Same CI-flake pattern 50028c9 fixed for two other tests: the testbench queue
workers' wake() poll calls TaskWatchdog::runPass in a separate PHP process
with a real-time now(). This test sets Carbon to 2026-04-09, so every Ready
task it drives through the DB carries a created_at ten real-time-days in
the past. TaskRepairPolicy::dispatchOverdue reads any task whose created_at
is more than redispatchAfterSeconds (3s) behind now() as overdue, so the
background worker redispatches the task via the real Bus (Queue::fake only
intercepts the test process's queue), and a worker then claims it before
the test's next runReadyTaskForRun() lookup lands — "Expected a ready
workflow task for run ..." at V2WorkflowTest:8194.
Pre-setting LOOP_THROTTLE_KEY for 60s makes any background wake() in that
window short-circuit at the throttle check, matching the pattern already
used for testActivityHeartbeatRenewsCurrentAttemptLease and
testRepairRecreatesMissingParentResumeTaskFromChildResolutionHistory.
Verified 15/15 green locally against the same docker stack that previously
reproduced ~10% flake (1/10 failing runs before the fix).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 09f7e56 commit 1839e7e
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1079 | 1079 | | |
1080 | 1080 | | |
1081 | 1081 | | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
1082 | 1090 | | |
1083 | 1091 | | |
1084 | 1092 | | |
| |||
0 commit comments