Skip to content

IT[TcpBrokerConnectionIT]: fix port collision, refactor - #125

Merged
678098 merged 1 commit into
bloomberg:mainfrom
678098:260826_fix_flaky_TcpBrokerConnectionIT
Aug 27, 2026
Merged

IT[TcpBrokerConnectionIT]: fix port collision, refactor#125
678098 merged 1 commit into
bloomberg:mainfrom
678098:260826_fix_flaky_TcpBrokerConnectionIT

Conversation

@678098

@678098 678098 commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator
  • Make sure 2 independent runs are not using the same ConnectionOptions (no port reuse)
  • Get rid of for loop, have 2 calls instead

Fixes the following IT flakiness:
[ERROR] Errors: [ERROR] com.bloomberg.bmq.it.TcpBrokerConnectionIT.testNegotiationMpsEx [ERROR] Run 1: TcpBrokerConnectionIT.testNegotiationMpsEx:626 » InternalServerError Status 500: {"message":"failed to set up container networking: driver failed programming external connectivity on endpoint bmq-broker-java-it45675 (b9ca11a29b8354259f0a9d216886dfa4df6fdbe5f44ed1218de0d8b45562f3d7): failed to bind host port for 0.0.0.0:45675:172.17.0.3:30114/tcp: address already in use"}

Signed-off-by: Evgeny Malygin <emalygin@bloomberg.net>
final TestTcpServer[] servers =
new TestTcpServer[] {
new BmqBrokerSimulator(opts.brokerUri().getPort(), Mode.BMQ_AUTO_MODE),
BmqBrokerContainer.createContainer(opts.brokerUri().getPort())

@678098 678098 Aug 26, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 2 servers were using the same port.
There were no guarantee that the async server stop will be triggered fast enough to let the second server get the port.
So the fix is to construct different ConnectionOptions for these 2 servers.
Also, possible to get rid of the array and for-loop by having 2 calls

@chrisbeard

Copy link
Copy Markdown
Contributor

Looks like this is related to message properties v1, which will be removed very soon too.

@678098

678098 commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

Looks like this is related to message properties v1, which will be removed very soon too.

Yes. Currently it blocks CI in dependabot PR.

@678098
678098 merged commit 22e455d into bloomberg:main Aug 27, 2026
3 checks passed
@678098
678098 deleted the 260826_fix_flaky_TcpBrokerConnectionIT branch August 27, 2026 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants