Skip to content

CAMEL-22527: Fix flaky JettyFailoverRoundRobinTest#22094

Merged
gnodet merged 2 commits intomainfrom
CAMEL-22527
Mar 19, 2026
Merged

CAMEL-22527: Fix flaky JettyFailoverRoundRobinTest#22094
gnodet merged 2 commits intomainfrom
CAMEL-22527

Conversation

@gnodet
Copy link
Contributor

@gnodet gnodet commented Mar 19, 2026

Summary

  • Fix flaky JettyFailoverRoundRobinTest that intermittently fails with BindException on CI
  • Root cause: static AvailablePortFinder.getNextAvailable() doesn't release ports, causing conflicts in parallel test runs
  • Fix: use @RegisterExtension AvailablePortFinder.Port with proper lifecycle management and @AfterEach cleanup
  • Move URL construction into createRouteBuilder() where port values are available

Test plan

  • Verified with multiple local runs
  • mvn test -B -pl components/camel-jetty -Dtest=JettyFailoverRoundRobinTest

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

Replace static port allocation with @RegisterExtension AvailablePortFinder.Port
and add proper port cleanup via @AfterEach to prevent port conflicts in CI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

🌟 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 build-all, build-dependents, 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.

@apupier
Copy link
Contributor

apupier commented Mar 19, 2026

/component-test jetty

@github-actions
Copy link
Contributor

/component-test jetty tests passed successfully.

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

  • components/camel-jetty: 3 test(s) disabled on GitHub Actions

@github-actions
Copy link
Contributor

🧪 CI tested the following changed modules:

  • components/camel-jetty

Port implements AfterAllCallback which auto-releases via afterAll().
The explicit @AfterEach release() calls were unnecessary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet merged commit 4c51214 into main Mar 19, 2026
5 checks passed
@gnodet gnodet deleted the CAMEL-22527 branch March 20, 2026 08:20
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