Skip to content

Pin the clock in the activity redelivery dispatch-window test - #952

Merged
rmcdaniel merged 1 commit into
mainfrom
server-932-pin-dispatch-minute
Nov 2, 2026
Merged

rmcdaniel merged 1 commit into
mainfrom
server-932-pin-dispatch-minute

Conversation

@rmcdaniel

@rmcdaniel rmcdaniel commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Review tier C: test-only (pins the clock in one PHPUnit feature test); no product code.

Fixes #932.

test_activity_redelivery_preserves_deadlines_without_new_attempt_or_dispatch asserts server_dispatch_count_this_minute is 1. That counter's cache key is now()->format('YmdHi') (TaskQueueAdmission::dispatchCounterKey), and the test ran on the real clock. If the dispatch and the queue read fell in different minutes, the read found a fresh key and returned 0 (seen on #925, run 41364820332).

Change

The test holds Carbon at the start of the current minute and releases it at the end, as its neighbours do. The array cache's TTL check uses the same clock, so the counter stays readable. No product code changes.

Checked

The PHPUnit feature suite in CI runs this test. This machine has no local PHP.

🤖 Generated with Claude Code

The per-minute dispatch counter is keyed by now()->format('YmdHi'). The
test dispatched in one wall-clock minute and could read the queue in the
next, so server_dispatch_count_this_minute read 0. Hold Carbon at the start
of the current minute for the test, as the neighbouring tests do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Nov 2, 2026

Copy link
Copy Markdown

@rmcdaniel
rmcdaniel marked this pull request as ready for review November 2, 2026 21:05
@rmcdaniel
rmcdaniel added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 0d88054 Nov 2, 2026
26 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky: ActivityTimeoutTest redelivery test reads the per-minute dispatch window on the real clock

1 participant