From commits-return-227978-archive-asf-public=cust-asf.ponee.io@cassandra.apache.org Thu Mar 5 09:53:03 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 12811180667 for ; Thu, 5 Mar 2020 10:53:02 +0100 (CET) Received: (qmail 87217 invoked by uid 500); 5 Mar 2020 09:53:02 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 87200 invoked by uid 99); 5 Mar 2020 09:53:02 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Mar 2020 09:53:02 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 85189E313D for ; Thu, 5 Mar 2020 09:53:01 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id 36FF5782307 for ; Thu, 5 Mar 2020 09:53:00 +0000 (UTC) Date: Thu, 5 Mar 2020 09:53:00 +0000 (UTC) From: "Michael Semb Wever (Jira)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-15622) Unit tests throw UnknownHostException trying to use `InetAddress.getLocalHost()` instead of `FBUtilities.getLocalAddress()` MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-15622?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Semb Wever updated CASSANDRA-15622: ------------------------------------------- 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 it likely not 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). (This is also ASF policy on this infrastructure.) The unit test code needs to replace these code occurrences with the call to {{`FBUtilities.getLocalAddress()`}} was: 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()`}} then resolves this public hostname. This is not listed in {{`/etc/hosts`}}, and we don't want it to be either (in case of accidental external port opening). (This is also ASF policy on this infrastructure.) The unit test code needs to replace these code occurrences with the call to {{`FBUtilities.getLocalAddress()`}} > Unit tests throw UnknownHostException trying to use `InetAddress.getLocalHost()` instead of `FBUtilities.getLocalAddress()` > --------------------------------------------------------------------------------------------------------------------------- > > Key: CASSANDRA-15622 > URL: https://issues.apache.org/jira/browse/CASSANDRA-15622 > Project: Cassandra > Issue Type: Bug > Components: Test/unit > Reporter: Michael Semb Wever > Assignee: Michael Semb Wever > Priority: Normal > Fix For: 2.2.x, 3.0.x, 3.11.x, 4.x > > > 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 it likely not 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). (This is also ASF policy on this infrastructure.) > The unit test code needs to replace these code occurrences with the call to {{`FBUtilities.getLocalAddress()`}} -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org For additional commands, e-mail: commits-help@cassandra.apache.org