You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2026/05/06 21:56:06 UTC
[PR] CAMEL-23431: Migrate small component tests from AvailablePortFinder to port-0 binding [camel]
gnodet opened a new pull request, #23023:
URL: https://github.com/apache/camel/pull/23023
[CAMEL-23431](https://issues.apache.org/jira/browse/CAMEL-23431)
## Summary
Migrates tests in small components (1-2 files with `AvailablePortFinder` usages) from the TOCTOU-prone `AvailablePortFinder.find()` pattern to atomic port-0 OS binding.
## Components migrated
| Component | File | Change |
|-----------|------|--------|
| `camel-jsch` | `ScpServerTestSupport` | `SshServer.setPort(0)` + reads actual port via `sshd.getPort()` after start |
| `camel-jsonpath` | `JsonPathPlatformHttpTest` | Stores `VertxPlatformHttpServer` as field, reads actual port via `server.getPort()` after start |
| `camel-vertx` | `VertxBaseTestSupport` | Removes unused `AvailablePortFinder` field and dead `getPort()` method (no subclass ever called it) |
| `camel-zookeeper-master` | `ZooKeeperGroupTest` | Replaces `AvailablePortFinder.getNextRandomAvailable()` with `ServerSocket(0)` for atomic port allocation |
## Components investigated but skipped
| Component | Reason |
|-----------|--------|
| `camel-undertow` | Port embedded in route builder URIs and `@BindToRegistry` properties before context start — chicken-and-egg |
| `camel-smpp` | Port embedded in route builder URIs and set as system property before simulator starts |
| `camel-platform-http-main` | `MainHttpServer.getPort()` / `ManagementHttpServer.getPort()` return the configured port, not the actual bound port — production code would need changes |
| `camel-milo` | Port used in `MiloServerComponent.setPort()` before context start |
| `camel-jmx` | `LocateRegistry.createRegistry()` does not support port 0 (RMI limitation) |
| `camel-atmosphere-websocket` | `JettyEmbeddedService` / `JettyConfiguration` do not expose actual bound port after port-0 start |
| `camel-zookeeper-master/GroupIT` | Uses `AvailablePortFinder` to pick a port for a real ZooKeeper testcontainer — testcontainers doesn't support port-0 binding |
_Claude Code on behalf of Guillaume Nodet_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-23431: Migrate small component tests from AvailablePortFinder to port-0 binding [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23023:
URL: https://github.com/apache/camel/pull/23023#issuecomment-4397659176
<!-- ci-tested-modules -->
:test_tube: **CI tested the following changed modules:**
- `components/camel-jsch`
- `components/camel-jsonpath`
- `components/camel-vertx/camel-vertx`
- `components/camel-zookeeper-master`
<details><summary>All tested modules (11 modules)</summary>
- Camel :: JBang :: MCP
- Camel :: JBang :: Plugin :: Route Parser
- Camel :: JBang :: Plugin :: TUI
- Camel :: JBang :: Plugin :: Validate
- Camel :: JSon Path
- Camel :: Jsch
- Camel :: Launcher :: Container
- Camel :: Vertx
- Camel :: YAML DSL :: Validator
- Camel :: YAML DSL :: Validator Maven Plugin
- Camel :: Zookeeper Master
</details>
---
:gear: [View full build and test results](https://github.com/apache/camel/actions/runs/25493018411)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-23431: Migrate small component tests from AvailablePortFinder to port-0 binding [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23023:
URL: https://github.com/apache/camel/pull/23023#issuecomment-4392491390
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:robot: CI automation will test this PR automatically.
:camel: 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](https://camel.apache.org/community/team/#committers) have access to the summary.
:warning: Be careful when sharing logs. Review their contents before sharing them publicly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-23431: Migrate small component tests from AvailablePortFinder to port-0 binding [camel]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet merged PR #23023:
URL: https://github.com/apache/camel/pull/23023
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org