gnodet commented on PR #27597:
URL: https://github.com/apache/camel/pull/27597#issuecomment-6129711091

   Thanks @apupier for the review!
   
   The `NoClassDefFoundError: Could not initialize class JmsReplyToIbmMQTest` 
is directly related to this PR's fix. Here's what happens:
   
   1. Both `JmsComponentIbmMQTest` and `JmsReplyToIbmMQTest` share a singleton 
IBM MQ container via `IbmMQServiceFactory.createSingletonService()`.
   2. The singleton is initialized as a `static` field in each test class — 
which means JUnit must initialize the class to run it (even just to check 
`@DisabledIfSystemProperty`).
   3. Before this fix, the `WaitAllStrategy` in 
`IbmMQLocalContainerInfraService` was using the default mode which caps the 
total wait time at 30 seconds — not enough for IBM MQ to start reliably. The 
container would time out during `initialize()`.
   4. When the singleton container fails to start in the first test class, the 
static initializer throws an exception. When JUnit then tries to load 
`JmsReplyToIbmMQTest` (to check the `@DisabledIfSystemProperty` annotation), 
Java finds the singleton in a broken state and throws `NoClassDefFoundError: 
Could not initialize class`.
   
   This PR switches to `WaitAllStrategy.Mode.WITH_INDIVIDUAL_TIMEOUTS_ONLY` and 
sets a 3-minute timeout per strategy, giving the IBM MQ container enough time 
to start reliably. The latest CI run (pushed 2026-10-12) is green, confirming 
the fix works for both tests.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to