You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "merlimat (via GitHub)" <gi...@apache.org> on 2026/04/03 21:16:49 UTC
[PR] [fix][test] Fix flaky BrokerRegistryIntegrationTest port binding race [pulsar]
merlimat opened a new pull request, #25463:
URL: https://github.com/apache/pulsar/pull/25463
## Motivation
`BrokerRegistryIntegrationTest.setup` is flaky due to a port binding race condition. Ports are allocated at field initialization time via `PortManager.nextFreePort()`, but by the time `@BeforeClass` runs, those ports may have been reused by another test class.
### Stack trace
```
Gradle suite > Gradle test > BrokerRegistryIntegrationTest > setup FAILED
java.io.IOException: java.net.BindException: Address already in use
at LocalBookkeeperEnsemble.runZookeeper(LocalBookkeeperEnsemble.java:219)
at LocalBookkeeperEnsemble.start(LocalBookkeeperEnsemble.java:420)
at BrokerRegistryIntegrationTest.setup(BrokerRegistryIntegrationTest.java:52)
Caused by: java.net.BindException: Address already in use
BrokerRegistryIntegrationTest.cleanup FAILED
java.lang.NullPointerException at BrokerRegistryIntegrationTest.java:71
```
## Modifications
- Move `LocalBookkeeperEnsemble` creation from field initialization to `@BeforeClass`
- Use port `0` for automatic OS port allocation instead of `PortManager.nextFreePort()`
- Add null guard for `bk` in cleanup to handle setup failures gracefully
### Documentation
- [x] `doc-not-required`
--
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@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][test] Fix flaky BrokerRegistryIntegrationTest port binding race [pulsar]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #25463:
URL: https://github.com/apache/pulsar/pull/25463#issuecomment-4185239088
@merlimat Please add the following content to your PR description and select a checkbox:
```
- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
```
--
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@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][test] Fix flaky BrokerRegistryIntegrationTest port binding race [pulsar]
Posted by "nodece (via GitHub)" <gi...@apache.org>.
nodece merged PR #25463:
URL: https://github.com/apache/pulsar/pull/25463
--
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@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org