mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Valery Kharseko
15 hours ago 12a5e3a1dfca3b334edd9378875464c80870fc4f
refs
author Valery Kharseko <vharseko@3a-systems.ru>
Wednesday, November 4, 2026 07:52 +0100
committer GitHub <noreply@github.com>
Wednesday, November 4, 2026 07:52 +0100
commit12a5e3a1dfca3b334edd9378875464c80870fc4f
tree b220f259dea8e37a8d0fc6530183e941c7fa7303 tree | zip | gz
parent 073f4eda43af479cd7645f5ab8a048932c612bcf view | diff
Fix JMX port-release test race on Linux (#1267)

The JMX port-release regression test added in #1264 can connect
successfully immediately after handler shutdown on Linux: the JDK may
defer socket disposal until a pending accept operation finishes. All
five Ubuntu jobs in [run
41635504530](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/41635504530)
failed this check.

Retry the port-release assertion using the existing `TestTimer`,
checking both connection refusal and successful rebinding in the same
attempt. Retry `BindException` as well; propagate other I/O errors. The
timer permits five seconds of total sleep in 10 ms steps; individual
connection attempts retain their existing timeout. Production code is
unchanged.

Follow-up to #1264, the implementation for #1261.

Validation:

- The original test fails on Linux / JDK 11 with the stopped registry
port still accepting connections.
- The updated class passes all 10 tests on Linux / JDK 11, 21 and 27,
with no skips.
- Maven reactor `-Pprecommit verify` with the full JMX package passes:
55 passed, 1 skipped, including Javadoc. The skip is the existing
wildcard-hostname case on the local loopback hostname.
- Removing the production `close(connectorSocketFactory)` call in a
separately compiled mutant makes all four port-release cases fail. The
retry still detects the actual leak.
- `git diff --check` passes. The full repository test suite was not run
locally.

```sh
mvn -o -Pprecommit verify -pl opendj-server-legacy -am \
'-Dit.test=org/opends/server/protocols/jmx/**' \
-Dfailsafe.failIfNoSpecifiedTests=false \
-Dtest=NoTestsSelected -Dsurefire.failIfNoSpecifiedTests=false
```
1 files modified
29 ■■■■■ changed files
opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxListenAddressTestCase.java 29 ●●●●● diff | view | raw | blame | history