Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8313997

The jdi/ListeningConnector/startListening/startlis001 may fail if the hosts file is modified

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 11, 17, 21, 22
    • core-svc
    • Fix Understood
    • generic
    • linux

      The test uses this code to create a list of valid adresses for the localhost:

              String hostname = "localhost";
              List<String> validAddresses = new LinkedList<>();
              validAddresses.add(hostname);
              Arrays.stream(InetAddress.getAllByName(hostname))
                          .forEach(address -> validAddresses.add(address.getHostAddress()));

      It does not work properly if the custom name is set for the 127.0.01 via /etc/hosts file. In that case the correct address will be "SomeCustomName:port".

      Additionally to the "localhost", the test should validate the name returned by the InetAddress.getLocalHost().getHostName().

            serb Sergey Bylokhov
            serb Sergey Bylokhov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: