Skip to content

Fix 11 flaky tests in camel-core caused by timing issues#23190

Closed
gnodet wants to merge 3 commits into
apache:mainfrom
gnodet:low-join
Closed

Fix 11 flaky tests in camel-core caused by timing issues#23190
gnodet wants to merge 3 commits into
apache:mainfrom
gnodet:low-join

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented May 13, 2026

Summary

Fix 11 intermittently failing tests in camel-core that pass on rerun (rerunFailingTestsCount=2), confirming they are timing-dependent.

File consumer delay=10 re-read fixes (6 tests)

File consumer with delay=10 (10ms poll interval) re-reads files before they are moved to .camel/, creating duplicate exchanges. Increased to delay=2000 for a single poll per test lifetime.

  • FileSedaShutdownCompleteAllTasksTest (expected 5, got 9)
  • ShutdownCompleteCurrentTaskOnlyTest (expected <5, got 5)
  • MarkerFileExclusiveReadLockStrategyTest
  • MarkerFileExclusiveReadLockStrategyUnlockTest
  • MarkerFileExclusiveReadLockStrategyRecursiveCleanupTest (5 test methods)
  • FileConsumeFilesAndDeleteTest

Thread pool / timing fixes (4 tests)

  • MulticastParallelStreamingTimeoutTest (expected "CB", got "Hello"): Thread pool starvation under CI prevented branches from completing within 5s timeout. Increased multicast timeout to 10s, direct:a delay to 20s.
  • MulticastParallelStreamingTest (expected "BA", got "AB"): asyncDelayed() uses scheduled executor subject to thread pool pressure. Switched to syncDelayed() (Thread.sleep) for deterministic ordering.
  • RecipientListParallelStreamingTest: Same asyncDelayed() issue. Added syncDelayed().
  • MulticastParallelTimeoutStreamCachingTest (expected mock:exception=1, got 0): IOException propagation exceeded default mock assertion timeout. Added explicit setResultWaitTime(15000).

Aggregation timeout fix (1 test)

  • AggregateCompleteAllOnStopTest: completionTimeout(100ms) fires between messages under CI load, prematurely completing aggregations. Increased to 5000ms.

Test plan

  • All 11 tests pass locally (21 test methods, 0 failures)
  • CI passes

- FileSedaShutdownCompleteAllTasksTest: increase file poll delay to prevent
  duplicate exchanges from re-reading files before .camel/ move
- ShutdownCompleteCurrentTaskOnlyTest: same file poll delay fix
- MulticastParallelStreamingTimeoutTest: increase multicast timeout and mock
  wait time to handle thread pool starvation under CI load
- MulticastParallelStreamingTest: use syncDelayed() instead of asyncDelayed()
  for deterministic delay ordering
- MulticastParallelTimeoutStreamCachingTest: increase mock result wait time
  for IOException propagation under CI load

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

ghost commented May 13, 2026

🌟 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
Copy link
Copy Markdown
Contributor

ghost commented May 13, 2026

🧪 CI tested the following changed modules:

  • core/camel-core

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • core/camel-core: 2 test(s) disabled on GitHub Actions

⚙️ View full build and test results

- MarkerFileExclusiveReadLockStrategyTest: increase file poll delay to
  prevent duplicate exchanges from re-reading files
- MarkerFileExclusiveReadLockStrategyUnlockTest: same file poll delay fix
- MarkerFileExclusiveReadLockStrategyRecursiveCleanupTest: same fix across
  all 5 test methods
- FileConsumeFilesAndDeleteTest: same file poll delay fix
- SedaBlockWhenFullTest: increase mock result wait time from 390ms to 1300ms
  to handle CI load delays
- AggregateCompleteAllOnStopTest: increase completionTimeout from 100ms to
  5000ms to prevent premature timeout-based completion between messages
- RecipientListParallelStreamingTest: use syncDelayed() for deterministic
  delay ordering under thread pool pressure

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gnodet gnodet changed the title Fix 5 flaky tests in camel-core caused by timing issues Fix 12 flaky tests in camel-core caused by timing issues May 13, 2026
…3178

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gnodet gnodet changed the title Fix 12 flaky tests in camel-core caused by timing issues Fix 11 flaky tests in camel-core caused by timing issues May 13, 2026
@gnodet gnodet closed this May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant