[Test] Bound the messenger consume helper with a time limit - #519
Merged
Merged
Conversation
GenericDataIndex::consume() ran messenger:consume with --limit=2 only, so it returned only after two handled messages. When a test enqueues fewer - which depends on what earlier tests left in the transport, i.e. on the random test order - the worker waited forever and the CI job hung until the job timeout (seen with seed 1743869738 in AssetBasicTest::testFolderIndexingAsynchronous). --time-limit=20 bounds the wait; a test that really lacks messages now fails on its own assertion instead of blocking the suite. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approved
The focused test-only change correctly prevents indefinite worker waits without affecting production code.
Review effort: Balanced
Findings: None
What changed in this PR
Bounds test messenger consumption to prevent hangs when fewer than two messages are queued.
Changes:
- Adds a 20-second time limit to the consume helper.
- Documents why both limits are needed.
| File | Description |
|---|---|
tests/Support/Helper/GenericDataIndex.php |
Adds bounded messenger consumption for tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Copilot
AI
dismissed their stale review, a newer Copilot review was requested
September 23, 2026 17:48
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.



Changes in this pull request
GenericDataIndex::consume()(tests/Support/Helper) ranmessenger:consumewith--limit=2only, so it returned only after two handled messages. When a test enqueues fewer — which depends on what earlier tests left in the transport, i.e. on the random test order — the worker waits forever and the Codeception job hangs until the job timeout.Seen on #513 (mysql leg, seed
1743869738): the job stopped producing output after ~6 min and ran for 80+ min. Reproduced locally with the same seed; a SIGUSR1 backtrace put the process inSymfony\Component\Messenger\Worker::run()→Clock::sleep(), called fromAssetBasicTest::testFolderIndexingAsynchronous→IndexTester::consume().This adds
--time-limit=20. A test that really lacks messages now fails on its own assertion within seconds instead of blocking the suite.Additional info
Verified locally: the Functional suite with seed
1743869738completes (169 tests OK, 5:41 min);AssetBasicTest::testFolderIndexingAsynchronouspasses after the 20 s bound. Test-only change, no production code touched.🤖 Generated with Claude Code