Skip to content

Fix flaky pause/resume queue tests#198

Merged
marickvantuil merged 2 commits into
masterfrom
fix/pause-resume-flaky-test
Jul 1, 2026
Merged

Fix flaky pause/resume queue tests#198
marickvantuil merged 2 commits into
masterfrom
fix/pause-resume-flaky-test

Conversation

@marickvantuil

Copy link
Copy Markdown
Member

The pause/resume tests polled getQueue() after mutating the queue, but those reads are eventually consistent and could still report the old state well beyond the backoff window, causing random failures.

Return the Queue from CloudTasksApi::pause()/resume() and assert on the RPC response, which carries the new state synchronously. This drops the polling helpers and makes the tests deterministic and independent of each other.

Also remove the now-stale PHPStan ignore for the QueuePaused/ QueueResumed events, which exist in the supported Laravel versions.

The pause/resume tests polled getQueue() after mutating the queue,
but those reads are eventually consistent and could still report the
old state well beyond the backoff window, causing random failures.

Return the Queue from CloudTasksApi::pause()/resume() and assert on
the RPC response, which carries the new state synchronously. This
drops the polling helpers and makes the tests deterministic and
independent of each other.

Also remove the now-stale PHPStan ignore for the QueuePaused/
QueueResumed events, which exist in the supported Laravel versions.
These events only exist in newer Laravel versions, and the code
guards them with class_exists(). The ignore is required on versions
where the classes are absent, but is unmatched where they exist, so
set reportUnmatchedIgnoredErrors: false instead of removing it.
@marickvantuil marickvantuil force-pushed the fix/pause-resume-flaky-test branch from 4642f32 to e4cb5dc Compare July 1, 2026 16:50
@marickvantuil marickvantuil merged commit 9b4aa16 into master Jul 1, 2026
45 checks passed
@marickvantuil marickvantuil deleted the fix/pause-resume-flaky-test branch July 1, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant