Skip to content

[Test] Bound the messenger consume helper with a time limit - #519

Merged
mcop1 merged 1 commit into
2.5from
fix/test-consume-time-limit
Sep 23, 2026
Merged

mcop1 merged 1 commit into
2.5from
fix/test-consume-time-limit

Conversation

@mcop1

@mcop1 mcop1 commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Changes in this pull request

GenericDataIndex::consume() (tests/Support/Helper) 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 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 in Symfony\Component\Messenger\Worker::run() → Clock::sleep(), called from AssetBasicTest::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 1743869738 completes (169 tests OK, 5:41 min); AssetBasicTest::testFolderIndexingAsynchronous passes after the 20 s bound. Test-only change, no production code touched.

🤖 Generated with Claude Code

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>
Copilot AI balanced review requested due to automatic review settings September 23, 2026 17:44
@mcop1 mcop1 added this to the 2.5.13 milestone Sep 23, 2026
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI previously approved these changes Sep 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approved

The focused test-only change correctly prevents indefinite worker waits without affecting production code.

Review effort: Balanced
Findings: None

@mcop1 mcop1 self-assigned this Sep 23, 2026
@mcop1
mcop1 merged commit d62d2ff into 2.5 Sep 23, 2026
20 of 21 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 23, 2026
@mcop1
mcop1 deleted the fix/test-consume-time-limit branch September 23, 2026 18:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants