Skip to content

CAMEL-21917: Fix flaky JMS transacted and security tests#21917

Merged
gnodet merged 1 commit intoapache:mainfrom
gnodet:fix/jms-security-test-jdk25
Mar 12, 2026
Merged

CAMEL-21917: Fix flaky JMS transacted and security tests#21917
gnodet merged 1 commit intoapache:mainfrom
gnodet:fix/jms-security-test-jdk25

Conversation

@gnodet
Copy link
Contributor

@gnodet gnodet commented Mar 10, 2026

Summary

Fix multiple flaky JMS transacted and security tests in camel-jms that were failing intermittently on CI (both JDK 21 and JDK 25).

Root Causes & Fixes

DLQ tests failing with null receive (JmsTransactedDeadLetterChannelNotHandlerRollbackOnExceptionIT, JmsTransactedDeadLetterChannelHandlerRollbackOnExceptionIT, JmsTransactedOnExceptionRollbackOnExceptionIT, JmsToJmsTransactedIT)

  • Artemis does not auto-create dead letter queues for custom DLQ addresses without autoCreateDeadLetterResources. Fixed by pre-creating the DLQ queue in broker config via cfg.addQueueConfiguration(QueueConfiguration.of(dlqName).setRoutingType(RoutingType.ANYCAST))
  • Use per-class DLQ names (DLQ.<ClassName>) to prevent interference between concurrent tests
  • Set explicit maxDeliveryAttempts (1 or 3) per test for faster, deterministic redelivery

Message leakage between test methods (RouteIdTransactedIT, JmsToJmsTransactedIT)

  • Tests sharing a broker queue could leak messages between methods when execution order was non-deterministic
  • Fixed with @TestMethodOrder(MethodOrderer.OrderAnnotation.class) and @Order annotations

Timeout flakiness under CI load

  • Increased Awaitility timeouts and @Timeout values in several tests that were too tight for CI

JDK 25 compatibility (JmsToJmsTransactedSecurityIT)

  • Fixed Artemis security configuration to work on JDK 25

Files Changed (22 files)

Category Files
DLQ test fixes JmsTransactedDeadLetterChannelNotHandlerRollbackOnExceptionIT, JmsTransactedDeadLetterChannelHandlerRollbackOnExceptionIT, JmsTransactedOnExceptionRollbackOnExceptionIT
Transacted test fixes JmsToJmsTransactedIT, RouteIdTransactedIT
Security test fix JmsToJmsTransactedSecurityIT
Timeout increases JmsProducerWithJMSHeaderTest, JmsRouteWithInOnlyAndMultipleAcksTest, JmsRouteWithInOnlyTest, AsyncConsumerInOutTwoTest, JmsAddAndRemoveRouteManagementIT, and others
Test infra AbstractArtemisEmbeddedService

@github-actions
Copy link
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@gnodet gnodet force-pushed the fix/jms-security-test-jdk25 branch from cb96fba to 8ec5bd6 Compare March 10, 2026 20:00
@gnodet gnodet force-pushed the fix/jms-security-test-jdk25 branch 2 times, most recently from 72c89a3 to cece145 Compare March 10, 2026 23:13
@gnodet gnodet marked this pull request as draft March 10, 2026 23:40
@gnodet gnodet force-pushed the fix/jms-security-test-jdk25 branch 4 times, most recently from 88b8121 to 25bd6b2 Compare March 11, 2026 06:30
@gnodet gnodet force-pushed the fix/jms-security-test-jdk25 branch from 25bd6b2 to 8204363 Compare March 11, 2026 06:39
@gnodet gnodet changed the title Fix JmsToJmsTransactedSecurityIT on JDK 25 CAMEL-21917: Fix flaky JMS transacted and management tests Mar 11, 2026
@gnodet gnodet force-pushed the fix/jms-security-test-jdk25 branch 2 times, most recently from 0978989 to 477e7e2 Compare March 11, 2026 16:15
- Pre-create custom DLQ queues in Artemis broker config, since Artemis
  does not auto-create dead letter queues for custom DLQ addresses
  without autoCreateDeadLetterResources enabled
- Use per-class DLQ names to avoid interference between concurrent tests
- Set explicit maxDeliveryAttempts (1 or 3) per test for faster and
  deterministic redelivery behavior
- Enforce test method ordering with @TestMethodOrder/@order to prevent
  message leakage via shared broker queues (RouteIdTransactedIT,
  JmsToJmsTransactedIT)
- Increase Awaitility/timeout values for CI stability under load
- Fix JmsToJmsTransactedSecurityIT to work on JDK 25 by using
  SASL_PLAINTEXT for Artemis security configuration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet changed the title CAMEL-21917: Fix flaky JMS transacted and management tests CAMEL-21917: Fix flaky JMS transacted and security tests Mar 11, 2026
@gnodet gnodet marked this pull request as ready for review March 11, 2026 22:15
@gnodet gnodet force-pushed the fix/jms-security-test-jdk25 branch from 8154608 to 209c428 Compare March 11, 2026 22:49
@gnodet gnodet merged commit 4a5e970 into apache:main Mar 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants