Repository navigation
Pin the clock in the activity redelivery dispatch-window test - #952
Merged
Merged
Conversation
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>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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_dispatchassertsserver_dispatch_count_this_minuteis 1. That counter's cache key isnow()->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