Skip to content

Assign random ports in Netty tests to prevent BindException #871

Merged
vjovanov merged 2 commits intomasterfrom
mm/netty-random-port-assignment
Dec 10, 2025
Merged

Assign random ports in Netty tests to prevent BindException #871
vjovanov merged 2 commits intomasterfrom
mm/netty-random-port-assignment

Conversation

@kimeta
Copy link
Copy Markdown
Collaborator

@kimeta kimeta commented Dec 9, 2025

What does this PR do?

Fixes: #870

This PR resolves an issue where Netty tests were using hard-coded ports, causing java.net.BindException: Address already in use errors during our automated CI workflows.

To address this, the affected Netty tests have been refactored to use randomly assigned available ports at runtime, preventing port conflicts and improving the reliability of test execution in the CI. This change should be applied to all test versions to ensure future reliability and enable safe automation when introducing new library versions.

@kimeta kimeta force-pushed the mm/netty-random-port-assignment branch from 36eda07 to 0a9e906 Compare December 9, 2025 22:00
@kimeta kimeta force-pushed the mm/netty-random-port-assignment branch from 0a9e906 to 9c5d4c4 Compare December 9, 2025 23:56
@vjovanov
Copy link
Copy Markdown
Member

@jormundur00 This should run all the netty versions, but it ended up running most of the repo. Any idea why?

@jormundur00
Copy link
Copy Markdown
Member

@jormundur00 This should run all the netty versions, but it ended up running most of the repo. Any idea why?

generateChangedCoordinatesMatrix operates by making a git diff with the latest master commit. The issue is that this PRs branch was opened from a point in master before changes such as #860, so the diff picks up changes such as:

diff --git a/tests/src/org.eclipse.paho/org.eclipse.paho.client.mqttv3/1.2.5/settings.gradle b/tests/src/org.eclipse.paho/org.eclipse.paho.client.mqttv3/1.2.5/settings.gradle
index 45a98c96..9d961121 100644
--- a/tests/src/org.eclipse.paho/org.eclipse.paho.client.mqttv3/1.2.5/settings.gradle
+++ b/tests/src/org.eclipse.paho/org.eclipse.paho.client.mqttv3/1.2.5/settings.gradle
@@ -1,9 +1,3 @@
-/*
- * Copyright and related rights waived via CC0
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
- */
 pluginManagement {
       def tckPath = Objects.requireNonNullElse(
               System.getenv("GVM_TCK_TCKDIR"),

These changes are the diff between the old master this branch originates from and the latest master.

Rebasing this branch to the latest master should solve the issue.

@vjovanov vjovanov merged commit df15a53 into master Dec 10, 2025
16 checks passed
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.

Bug: Netty tests should use random port assignment

3 participants