CAMEL-22539: Fix and re-enable 13 flaky tests in camel-core#23020
Merged
gnodet merged 1 commit intoapache:mainfrom May 6, 2026
Merged
CAMEL-22539: Fix and re-enable 13 flaky tests in camel-core#23020gnodet merged 1 commit intoapache:mainfrom
gnodet merged 1 commit intoapache:mainfrom
Conversation
- AggregateProcessorTest: replace Thread.sleep with Awaitility, increase completion timeouts - DefaultTimeoutMapTest: replace Thread.sleep with Awaitility poll loop - StopTimeoutRouteTest: add CountDownLatch to synchronize async send with route stop - AggregateLostGroupIssueTest: replace fragile timer with direct message sending - AlbertoAggregatorTest: increase completionTimeout from 100ms to 2000ms - AggregatorWithBatchConsumingIssueTest: add @isolated - FileConsumerMoveFailureTest: increase polling delays, use Awaitility for file checks - FileConsumerPollStrategyStopOnRollbackTest: reset static fields in @beforeeach - ConcurrentRequestsThrottlerTest: replace Thread.sleep with Awaitility between phases - ThrottlerTest: increase timing slack, replace Thread.sleep, clean executor shutdown - AsyncProcessorAwaitManagerInterruptWithRedeliveryTest: increase redelivery delay - CamelPostProcessorHelperSedaConsumePredicateTest: use expectedBodiesReceivedInAnyOrder - TrustManagersParametersTest: properly create/close CamelContext per test Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
Contributor
|
🧪 CI tested the following changed modules:
|
davsclaus
approved these changes
May 6, 2026
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CAMEL-22539
Summary
Fix and re-enable 13 flaky tests in
core/camel-corethat 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: replacedThread.sleep(5/10/150/250)withAwaitility.await().untilAsserted()to wait for completion timeout to fire before sending next message; increased completion timeouts 100→500msDefaultTimeoutMapTest: replacedThread.sleep(50)with Awaitility poll loop intestDefaultTimeoutMapForcePurgeConcurrentRequestsThrottlerTest: replacedThread.sleep(INTERVAL)between throttle phases with AwaitilityThrottlerTest: replacedThread.sleep(INTERVAL + TOLERANCE)with Awaitility; increased timing slack 1000→3000ms; clean executor shutdownAdd synchronization for race conditions:
StopTimeoutRouteTest: addedprocessingStartedCountDownLatch so test waits for async processing to begin before callingstopRouteReplace timer with controlled sending:
AggregateLostGroupIssueTest: replaced fragiletimer://foo?period=10route with direct message sending loop — timer scheduling on slow CI caused completionTimeout to fire partial groupsIncrease timeouts for synchronous processing:
AlbertoAggregatorTest: increasedcompletionTimeout100→2000ms and checker interval 10→100ms — the timeout is just a flush mechanism after synchronous split processingAsyncProcessorAwaitManagerInterruptWithRedeliveryTest: increased redelivery delay 750→1500msFix test isolation and ordering:
AggregatorWithBatchConsumingIssueTest: added@Isolatedto prevent parallel test interferenceCamelPostProcessorHelperSedaConsumePredicateTest: changed toexpectedBodiesReceivedInAnyOrder— competing SEDA consumers have non-deterministic delivery orderFileConsumerPollStrategyStopOnRollbackTest: reset static mutable fields (counter,event) in@BeforeEachFix file consumer timing:
FileConsumerMoveFailureTest: increasedinitialDelay/delayto 100ms; replacedexpectedFileExistswith explicit Awaitility file existence checksFix resource leaks:
TrustManagersParametersTest: added@BeforeEach/@AfterEachto properly create and closeCamelContext— leaked contexts left background threads runningTest plan