Skip to content

CAMEL-23430: Fix flaky tests in camel-kafka#22979

Open
gnodet wants to merge 2 commits intoapache:mainfrom
gnodet:CAMEL-23430-fix-flaky-kafka-tests
Open

CAMEL-23430: Fix flaky tests in camel-kafka#22979
gnodet wants to merge 2 commits intoapache:mainfrom
gnodet:CAMEL-23430-fix-flaky-kafka-tests

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented May 5, 2026

CAMEL-23430

Fix two flaky tests in camel-kafka:

KafkaConsumerAutoInstResumeRouteStrategyIT.testOffsetIsBeingChecked:

  • Producer was never flushed or closed after sending messages — messages may not have been delivered to Kafka when the test starts consuming
  • mock.assertIsSatisfied() was called without any wait timeout — the assertion checked immediately before the route had time to consume and process messages
  • Fix: use try-with-resources for the producer with an explicit flush, and use Awaitility to wait for the mock assertion

KafkaIdempotentRepositoryEagerIT.createRepositoryTopic (via KafkaTestUtil.createTopic):

  • The describeTopics() future had only a 5-second timeout, which is too tight when the Kafka broker is still warming up
  • The AdminClient was never closed, leaking resources
  • Fix: increase timeout to 30 seconds and use try-with-resources for the AdminClient

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gnodet gnodet requested review from apupier and oscerd May 5, 2026 21:14
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 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

github-actions Bot commented May 5, 2026

🧪 CI tested the following changed modules:

  • components/camel-kafka

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

  • components/camel-kafka: 3 test(s) disabled on GitHub Actions
All tested modules (8 modules)
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Kafka
  • Camel :: Launcher :: Container
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

…eption on retries

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gnodet gnodet marked this pull request as draft May 6, 2026 06:34
@gnodet gnodet marked this pull request as ready for review May 6, 2026 07:26
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