Skip to content

CAMEL-23431: Migrate camel-grpc and camel-mllp tests from AvailablePortFinder to port-0 binding#23037

Draft
gnodet wants to merge 3 commits intoapache:mainfrom
gnodet:CAMEL-23431-port0-mllp
Draft

CAMEL-23431: Migrate camel-grpc and camel-mllp tests from AvailablePortFinder to port-0 binding#23037
gnodet wants to merge 3 commits intoapache:mainfrom
gnodet:CAMEL-23431-port0-mllp

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented May 7, 2026

CAMEL-23431

Migrate camel-grpc and camel-mllp tests from AvailablePortFinder to port-0 ServerSocket binding, eliminating TOCTOU race conditions that can cause flaky BindException failures.

Changes

camel-grpc

  • Add getLocalPort() to GrpcConsumer to expose the OS-assigned port after server start
  • Change port validation from > 0 to >= 0 to allow port 0 (OS-assigned)
  • Migrate all 14 test files to use port 0 and read back the actual port

camel-mllp

  • Add getLocalPort() to MllpTcpServerConsumer to expose the OS-assigned port
  • Migrate 6 test files to use port 0 and read back the actual port

Test plan

  • CI passes for camel-grpc tests
  • CI passes for camel-mllp tests
  • No regressions in other modules

…rtFinder to port-0 binding

- Add getLocalPort() to GrpcConsumer to expose OS-assigned port
- Allow port 0 in GrpcConsumer by changing port check from > 0 to >= 0
- Add getLocalPort() to MllpTcpServerConsumer to expose OS-assigned port
- Migrate all grpc and mllp tests to use port 0 instead of AvailablePortFinder

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gnodet gnodet requested review from cunningt and gzurowski May 7, 2026 09:27
@github-actions
Copy link
Copy Markdown
Contributor

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

gnodet and others added 2 commits May 7, 2026 12:43
…hread

The serverSocket field is package-private, so access it via a public
getter instead of direct field access from MllpTcpServerConsumer.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Shorten java.util.concurrent.TimeUnit to import + simple name to
satisfy the OpenRewrite FQCN check in CI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the core label May 7, 2026
@davsclaus
Copy link
Copy Markdown
Contributor

@gnodet can you update this PR as it has merge conflicts now

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