Skip to content

test: fix flaky batchJMS_TESTS startup race - #6850

Open
rebelwithoutacause wants to merge 1 commit into
apache:masterfrom
rebelwithoutacause:fix-flaky-jms-tests
Open

rebelwithoutacause wants to merge 1 commit into
apache:masterfrom
rebelwithoutacause:fix-flaky-jms-tests

Conversation

@rebelwithoutacause

Copy link
Copy Markdown
Contributor

Description

This change fixes an intermittent failure in the batchJMS_TESTS batch test.

The JSR223 consumer script in bin/testfiles/JMS_TESTS.jmx now starts the JMS connection before it creates the message consumer and registers its listener. Before this change, the connection was started after the consumer and listener were set up.

The only file changed is bin/testfiles/JMS_TESTS.jmx.

Motivation and Context

In the original order, the request message could already be waiting in the queue when the consumer was created, especially on slower CI runners. ActiveMQ then delivered it to the connection before it was started and logged a warning:

WARN o.a.a.ActiveMQSessionExecutor: Received a message on a connection which is not yet started. Have you forgotten to call Connection.start()? ...

The message was still processed and all JMS samples completed successfully. The batch test failed anyway, because it requires the generated log to be empty.

Related CI failure (macOS / JDK 17 job, :src:dist-check:batchJMS_TESTS):
https://github.com/apache/jmeter/actions/runs/41797884332

How Has This Been Tested?

  • Ran ./gradlew :src:dist-check:batchJMS_TESTS locally on Windows with JDK 21. The test passed: all 27 samples completed with 0 errors.
  • Verified that JMS_TESTS.log was empty.
  • git diff --check passed.

The failure is timing-dependent and was seen on the macOS / JDK 17 CI job, so the local Windows run cannot prove the race is gone. Upstream CI still needs to confirm the fix on the affected macOS / JDK 17 job.

Screenshots (if appropriate):

Not applicable.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly (not applicable).

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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