gnodet opened a new pull request, #23020:
URL: https://github.com/apache/camel/pull/23020

   [CAMEL-22539](https://issues.apache.org/jira/browse/CAMEL-22539)
   
   ## Summary
   
   Fix and re-enable 13 flaky tests in `core/camel-core` that were disabled on 
CI via `@DisabledIfSystemProperty(named = "ci.env.name")`. Each test's root 
cause was analyzed and a structural fix applied rather than just increasing 
timeouts.
   
   ### Fixes by category
   
   **Replace Thread.sleep with Awaitility:**
   - `AggregateProcessorTest`: replaced `Thread.sleep(5/10/150/250)` with 
`Awaitility.await().untilAsserted()` to wait for completion timeout to fire 
before sending next message; increased completion timeouts 100→500ms
   - `DefaultTimeoutMapTest`: replaced `Thread.sleep(50)` with Awaitility poll 
loop in `testDefaultTimeoutMapForcePurge`
   - `ConcurrentRequestsThrottlerTest`: replaced `Thread.sleep(INTERVAL)` 
between throttle phases with Awaitility
   - `ThrottlerTest`: replaced `Thread.sleep(INTERVAL + TOLERANCE)` with 
Awaitility; increased timing slack 1000→3000ms; clean executor shutdown
   
   **Add synchronization for race conditions:**
   - `StopTimeoutRouteTest`: added `processingStarted` CountDownLatch so test 
waits for async processing to begin before calling `stopRoute`
   
   **Replace timer with controlled sending:**
   - `AggregateLostGroupIssueTest`: replaced fragile `timer://foo?period=10` 
route with direct message sending loop — timer scheduling on slow CI caused 
completionTimeout to fire partial groups
   
   **Increase timeouts for synchronous processing:**
   - `AlbertoAggregatorTest`: increased `completionTimeout` 100→2000ms and 
checker interval 10→100ms — the timeout is just a flush mechanism after 
synchronous split processing
   - `AsyncProcessorAwaitManagerInterruptWithRedeliveryTest`: increased 
redelivery delay 750→1500ms
   
   **Fix test isolation and ordering:**
   - `AggregatorWithBatchConsumingIssueTest`: added `@Isolated` to prevent 
parallel test interference
   - `CamelPostProcessorHelperSedaConsumePredicateTest`: changed to 
`expectedBodiesReceivedInAnyOrder` — competing SEDA consumers have 
non-deterministic delivery order
   - `FileConsumerPollStrategyStopOnRollbackTest`: reset static mutable fields 
(`counter`, `event`) in `@BeforeEach`
   
   **Fix file consumer timing:**
   - `FileConsumerMoveFailureTest`: increased `initialDelay`/`delay` to 100ms; 
replaced `expectedFileExists` with explicit Awaitility file existence checks
   
   **Fix resource leaks:**
   - `TrustManagersParametersTest`: added `@BeforeEach`/`@AfterEach` to 
properly create and close `CamelContext` — leaked contexts left background 
threads running
   
   ## Test plan
   
   - [x] All 13 test classes (50 test methods) pass locally
   - [x] 10 consecutive iterations (500 test executions) with zero failures
   - [ ] CI passes with all tests re-enabled


-- 
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