From 2a77254b72447b6b60f57110b3cf716249036085 Mon Sep 17 00:00:00 2001
From: Valery Kharseko <vharseko@3a-systems.ru>
Date: Tue, 15 Sep 2026 14:00:39 +0000
Subject: [PATCH] [#1031] Keep the replication test's admin and replication ports out of the ephemeral range (#1033)

---
 .github/workflows/build.yml |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 9bb01cd..aa484d4 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -293,6 +293,9 @@
       # dsreplication enable can hang indefinitely; without a timeout a hang
       # holds the runner until the 6-hour job limit. Normal duration is ~4 min.
       timeout-minutes: 30
+      # Every listen port stays below 32768: Linux hands out 32768-60999 as source ports
+      # for outgoing connections, and a server whose admin or replication port sits in
+      # that range loses it at random to whatever else is dialling out (#1031).
       run: |
         cp -r ./opendj-server-legacy/target/package/opendj ./opendj-server-legacy/target/package/opendj1
         cp -r ./opendj-server-legacy/target/package/opendj ./opendj-server-legacy/target/package/opendj2
@@ -306,32 +309,32 @@
         
         echo "Setup OpenDJ-2 with replication"
         
-        opendj-server-legacy/target/package/opendj2/setup -h localhost -p 2389 --ldapsPort 2636 --adminConnectorPort 24444 --enableStartTLS \
+        opendj-server-legacy/target/package/opendj2/setup -h localhost -p 2389 --ldapsPort 2636 --adminConnectorPort 4445 --enableStartTLS \
         --generateSelfSignedCertificate --rootUserDN "cn=Directory Manager" --rootUserPassword password --baseDN dc=example,dc=com \
         --addBaseEntry --cli --acceptLicense --no-prompt
         
         opendj-server-legacy/target/package/opendj2/bin/dsreplication enable --no-prompt --host1 localhost --port1 4444 --bindDN1 "cn=Directory Manager"  --bindPassword1 password --replicationPort1 8989 \
-        --host2 localhost --port2 24444 --bindDN2 "cn=Directory Manager" --bindPassword2 password --replicationPort2 28989 \
+        --host2 localhost --port2 4445 --bindDN2 "cn=Directory Manager" --bindPassword2 password --replicationPort2 8990 \
         --adminUID admin --adminPassword password --baseDN dc=example,dc=com --trustAll --noPropertiesFile
         
         opendj-server-legacy/target/package/opendj2/bin/dsreplication initialize --baseDN dc=example,dc=com --adminUID admin --adminPassword password --hostSource localhost \
-        --portSource 4444 --hostDestination localhost --portDestination 24444 -X -n
+        --portSource 4444 --hostDestination localhost --portDestination 4445 -X -n
         
         opendj-server-legacy/target/package/opendj2/bin/ldapsearch --port 2636 --hostname localhost --bindDN "cn=Directory Manager" --bindPassword password --useSsl --trustAll \
         --baseDN "ou=people,dc=example,dc=com" --searchScope sub "(uid=user.*)" dn  | grep ^dn: | wc -l | grep -q 100000
         
         echo "Setup OpenDJ-3 with replication"
         
-        opendj-server-legacy/target/package/opendj3/setup -h localhost -p 3389 --ldapsPort 3636 --adminConnectorPort 34444 --enableStartTLS \
+        opendj-server-legacy/target/package/opendj3/setup -h localhost -p 3389 --ldapsPort 3636 --adminConnectorPort 4446 --enableStartTLS \
         --generateSelfSignedCertificate --rootUserDN "cn=Directory Manager" --rootUserPassword password --baseDN dc=example,dc=com \
         --addBaseEntry --cli --acceptLicense --no-prompt
         
-        opendj-server-legacy/target/package/opendj3/bin/dsreplication enable --no-prompt --host1 localhost --port1 24444 --bindDN1 "cn=Directory Manager"  --bindPassword1 password --replicationPort1 28989 \
-        --host2 localhost --port2 34444 --bindDN2 "cn=Directory Manager" --bindPassword2 password --replicationPort2 38989 \
+        opendj-server-legacy/target/package/opendj3/bin/dsreplication enable --no-prompt --host1 localhost --port1 4445 --bindDN1 "cn=Directory Manager"  --bindPassword1 password --replicationPort1 8990 \
+        --host2 localhost --port2 4446 --bindDN2 "cn=Directory Manager" --bindPassword2 password --replicationPort2 8991 \
         --adminUID admin --adminPassword password --baseDN dc=example,dc=com --trustAll --noPropertiesFile
         
         opendj-server-legacy/target/package/opendj3/bin/dsreplication initialize --baseDN dc=example,dc=com --adminUID admin --adminPassword password --hostSource localhost \
-        --portSource 24444 --hostDestination localhost --portDestination 34444 -X -n
+        --portSource 4445 --hostDestination localhost --portDestination 4446 -X -n
         
         opendj-server-legacy/target/package/opendj2/bin/ldapsearch --port 3636 --hostname localhost --bindDN "cn=Directory Manager" --bindPassword password --useSsl --trustAll \
         --baseDN "ou=people,dc=example,dc=com" --searchScope sub "(uid=user.*)" dn  | grep ^dn: | wc -l | grep -q 100000

--
Gitblit v1.10.0