Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-15622

Unit tests throw UnknownHostException trying to use `InetAddress.getLocalHost()` instead of `FBUtilities.getLocalAddress()`

    XMLWordPrintableJSON

Details

    Description

      Many of the unit tests in Jenkins fail because of the use of `InetAddress.getLocalHost()` in the test classes.

      The Jenkins agents need a public ipaddress (and a hostname associated to it) so the Jenkins master can connect to them (agents can be hosted externally, by donating third-parties).

      The call to `InetAddress.getLocalHost()` can resolve to a hostname that can't be looked up.
      Not only can it not be listed in `/etc/hosts`, but we don't want it to be either (in case of accidental external port opening if the hostname points to the public ipaddress). (Which is also ASF policy on this infrastructure.)

      The unit test code needs to replace these code occurrences with the call to `FBUtilities.getLocalAddress()`

      Attachments

        Activity

          People

            mck Michael Semb Wever
            mck Michael Semb Wever
            Michael Semb Wever
            Benjamin Lerer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: