Skip to content

CAMEL-25234: Fix flaky JmsComponentIbmMQTest by extending IBM MQ container startup timeout - #27597

Draft
gnodet wants to merge 1 commit into
apache:mainfrom
gnodet:camel-25234-ibmmq-startup-timeout
Draft

gnodet wants to merge 1 commit into
apache:mainfrom
gnodet:camel-25234-ibmmq-startup-timeout

Conversation

@gnodet

@gnodet gnodet commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix the flaky JmsComponentIbmMQTest by extending the IBM MQ container startup timeout from the default 60 seconds to 3 minutes.

Root Cause

The IBM MQ container image was upgraded from 9.x to icr.io/ibm-messaging/mq:10.0.0.0-r4 (commit 9f3ff2e). The 10.0 image is heavier and occasionally exceeds the default Testcontainers Wait.forListeningPort() 60-second startup timeout on resource-constrained CI nodes, causing:

ContainerLaunchException: Timed out waiting for container port to open
  (localhost ports: [45267, 45268] should be listening)

The test has been flaky 125 times and failed once since August 24th; it was never flaky before the image upgrade.

Fix

Add .withStartupTimeout(Duration.ofMinutes(3L)) to the WaitAllStrategy in IbmMQLocalContainerInfraService, consistent with other heavy containers in the Camel test-infra codebase:

  • camel-test-infra-fhir — 3 minutes
  • camel-test-infra-keycloak — 3 minutes
  • camel-test-infra-neo4j — 3 minutes
  • camel-test-infra-milvus — 3 minutes
  • camel-test-infra-pinecone — 3 minutes

Tests

The existing JmsComponentIbmMQTest provides the regression coverage. The fix gives the container enough time to start on slow CI nodes, eliminating the timeout-induced flakiness.

Fixes https://issues.apache.org/jira/browse/CAMEL-25234


Hermes Agent (Claude Sonnet 4.6) on behalf of Guillaume Nodet

…ainer startup timeout

The IBM MQ 10.0 container image (icr.io/ibm-messaging/mq:10.0.0.0-r4), introduced
in commit 9f3ff2e, is heavier than the previous 9.x image and occasionally
exceeds the default 60-second Testcontainers startup timeout on resource-constrained
CI nodes. The failure manifests as ContainerLaunchException: Timed out waiting for
container port to open.

Add an explicit .withStartupTimeout(Duration.ofMinutes(3L)) to the WaitAllStrategy
in IbmMQLocalContainerInfraService, consistent with other heavy containers in the
codebase (FHIR, Keycloak, Neo4j, Milvus, etc.).

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@gnodet gnodet added the test label Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
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 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.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • test-infra/camel-test-infra-ibmmq

🔬 Scalpel shadow comparison — Scalpel: 14 of 704 tested, 27 compile-only — current: 14 all tested

Maveniverse Scalpel detected 14 affected modules (current approach: 14).

Skip-tests mode would test 14 modules (1 direct + 13 downstream), skip tests for 27 (generated code, meta-modules)

Modules Scalpel would test (14)
  • camel-activemq ← downstream of org.apache.camel:camel-jms
  • camel-activemq6 ← downstream of org.apache.camel:camel-jms
  • camel-amqp ← downstream of org.apache.camel:camel-jms
  • camel-jbang-mcp ← downstream of org.apache.camel:camel-catalog
  • camel-jbang-plugin-mcp ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-route-parser ← downstream of org.apache.camel:camel-route-parser
  • camel-jbang-plugin-tui ← downstream of org.apache.camel:camel-catalog
  • camel-jbang-plugin-validate ← downstream of org.apache.camel:camel-yaml-dsl-validator
  • camel-jms ← downstream of org.apache.camel:camel-test-infra-ibmmq
  • camel-launcher-container ← downstream of org.apache.camel:camel-launcher
  • camel-test-infra-all ← downstream of org.apache.camel:camel-test-infra-ibmmq
  • camel-test-infra-ibmmq ← test-infra/camel-test-infra-ibmmq/src/main/java/org/apache/camel/test/infra/ibmmq/services/IbmMQLocalContainerInfraService.java
  • camel-yaml-dsl-validator ← downstream of org.apache.camel:camel-catalog
  • camel-yaml-dsl-validator-maven-plugin ← downstream of org.apache.camel:camel-yaml-dsl-validator
Modules with tests skipped (27)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

All tested modules (41 modules, 22.1s total)

Total reactor time: 22.1s

Module Duration Status
Camel :: Test Infra :: All test services 17.7s SUCCESS
Camel :: Test Infra :: IBM MQ 4.4s SUCCESS
Camel :: AMQP n/a
Camel :: ActiveMQ 5.x n/a
Camel :: ActiveMQ 6.x n/a
Camel :: All Components Sync point n/a
Camel :: Assembly n/a
Camel :: Catalog :: Camel Catalog n/a
Camel :: Catalog :: Camel Report Maven Plugin n/a
Camel :: Catalog :: Camel Route Parser n/a
Camel :: Catalog :: Console n/a
Camel :: Catalog :: Dummy Component n/a
Camel :: Catalog :: Maven n/a
Camel :: Catalog :: Suggest (deprecated) n/a
Camel :: Component DSL n/a
Camel :: Coverage n/a
Camel :: Docs n/a
Camel :: Endpoint DSL n/a
Camel :: Endpoint DSL :: Support n/a
Camel :: Integration Tests n/a
Camel :: JBang :: Core n/a
Camel :: JBang :: Integration tests n/a
Camel :: JBang :: MCP n/a
Camel :: JBang :: Main n/a
Camel :: JBang :: Plugin :: Edit n/a
Camel :: JBang :: Plugin :: Generate n/a
Camel :: JBang :: Plugin :: Kubernetes n/a
Camel :: JBang :: Plugin :: MCP n/a
Camel :: JBang :: Plugin :: Route Parser n/a
Camel :: JBang :: Plugin :: TUI n/a
Camel :: JBang :: Plugin :: Testing n/a
Camel :: JBang :: Plugin :: Validate n/a
Camel :: JMS n/a
Camel :: Kamelet Main n/a
Camel :: Launcher n/a
Camel :: Launcher :: Container n/a
Camel :: YAML DSL n/a
Camel :: YAML DSL :: Deserializers n/a
Camel :: YAML DSL :: Maven Plugins n/a
Camel :: YAML DSL :: Validator n/a
Camel :: YAML DSL :: Validator Maven Plugin n/a

Top 20 slowest modules:

  • Camel :: Test Infra :: All test services (17.7s)
  • Camel :: Test Infra :: IBM MQ (4.4s)

⚙️ View full build and test results

@apupier apupier 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.

i do not undertand how it can be related to this PR change but the PR check is reporting:

[camel-jms] [ERROR] org.apache.camel.component.jms.issues.JmsReplyToIbmMQTest -- Time elapsed: 0.001 s <<< ERROR!
  java.lang.NoClassDefFoundError: Could not initialize class org.apache.camel.component.jms.issues.JmsReplyToIbmMQTest
  	at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
  	at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1169)
  	at java.base/java.lang.reflect.Field.acquireOverrideFieldAccessor(Field.java:1195)
  	at java.base/java.lang.reflect.Field.getOverrideFieldAccessor(Field.java:1164)
  	at java.base/java.lang.reflect.Field.get(Field.java:440)
  	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186)
  	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
  	at java.base/java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:395)
  	at java.base/java.util.stream.DistinctOps$1$2.end(DistinctOps.java:168)
  	at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:261)
  	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:571)
  	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
  	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:153)
  	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:176)
  	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
  	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:632)
  	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:511)
  	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.tryRemoveAndExec(ForkJoinPool.java:1490)
  	at java.base/java.util.concurrent.ForkJoinPool.helpJoin(ForkJoinPool.java:2248)
  	at java.base/java.util.concurrent.ForkJoinTask.awaitDone(ForkJoinTask.java:499)
  	at java.base/java.util.concurrent.ForkJoinTask.join(ForkJoinTask.java:669)
  	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:511)
  	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1450)
  	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2019)
  	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:187)
  Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.NoClassDefFoundError: Could not initialize class org.apache.camel.test.infra.ibmmq.services.IbmMQServiceFactory$SingletonServiceHolder [in thread "ForkJoinPool-1-worker-1"]
  	at org.apache.camel.test.infra.ibmmq.services.IbmMQServiceFactory.createSingletonService(IbmMQServiceFactory.java:60)
  	at org.apache.camel.component.jms.issues.JmsReplyToIbmMQTest.<clinit>(JmsReplyToIbmMQTest.java:42)
  [camel-jms] [INFO] Running org.apache.camel.component.jms.JmsComponentIbmMQTest

@apupier

apupier commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

on CI, the test can take around a minute so sounds plausible that there is some timeout around 1 minute hit
image

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.

2 participants