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

Fabio Pistolesi
11.32.2016 480fb3dccbdef7f5821b9d9dc987096d833b8300
Fix unit tests failing on some OSes with Address already in use

Some OSes allow bind() on specific IP addresses even when the port is already in use on the ANY address. Change socket creation to also use ANY instead of localhost.
1 files modified
2 ■■■ changed files
opendj-server-legacy/src/test/java/org/opends/server/TestCaseUtils.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/TestCaseUtils.java
@@ -654,7 +654,7 @@
  {
    ServerSocket serverLdapSocket = new ServerSocket();
    serverLdapSocket.setReuseAddress(true);
    serverLdapSocket.bind(new InetSocketAddress("127.0.0.1", port));
    serverLdapSocket.bind(new InetSocketAddress(port));
    return serverLdapSocket;
  }