This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git


The following commit(s) were added to refs/heads/master by this push:
     new d0182a7  Use the loopback address for connecting to an in-process web 
server
d0182a7 is described below

commit d0182a770c1c1c20aaa7392fc94466d10a8d6397
Author: Maarten Mulders <[email protected]>
AuthorDate: Mon Apr 19 16:59:24 2021 +0200

    Use the loopback address for connecting to an in-process web server
    
    This may resolve the connection issues we sometimes see in GitHub
    Actions where the Maven process that is being tested cannot connect
    to the Jetty server that was just started.
    
    This closes #107
---
 .../java/org/apache/maven/it/MavenIT0146InstallerSnapshotNaming.java  | 4 ++--
 .../java/org/apache/maven/it/MavenITmng2387InactiveProxyTest.java     | 2 +-
 .../java/org/apache/maven/it/MavenITmng4991NonProxyHostsTest.java     | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0146InstallerSnapshotNaming.java
 
b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0146InstallerSnapshotNaming.java
index 0d18182..ea21ec9 100644
--- 
a/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0146InstallerSnapshotNaming.java
+++ 
b/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0146InstallerSnapshotNaming.java
@@ -86,7 +86,7 @@ public class MavenIT0146InstallerSnapshotNaming
         Verifier verifier = newVerifier( testDir.getAbsolutePath() );
 
         Properties properties = verifier.newDefaultFilterProperties();
-        properties.setProperty( "@host@", 
InetAddress.getLocalHost().getCanonicalHostName() );
+        properties.setProperty( "@host@", 
InetAddress.getLoopbackAddress().getCanonicalHostName() );
         properties.setProperty( "@port@", Integer.toString( port ) );
 
         verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", 
properties );
@@ -125,7 +125,7 @@ public class MavenIT0146InstallerSnapshotNaming
         verifier = newVerifier( testDir.getAbsolutePath() );
 
         Properties properties = verifier.newDefaultFilterProperties();
-        properties.setProperty( "@host@", 
InetAddress.getLocalHost().getCanonicalHostName() );
+        properties.setProperty( "@host@", 
InetAddress.getLoopbackAddress().getCanonicalHostName() );
         properties.setProperty( "@port@", Integer.toString( port ) );
 
         verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", 
properties );
diff --git 
a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2387InactiveProxyTest.java
 
b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2387InactiveProxyTest.java
index e5ed71e..50de0a8 100644
--- 
a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2387InactiveProxyTest.java
+++ 
b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2387InactiveProxyTest.java
@@ -119,7 +119,7 @@ public class MavenITmng2387InactiveProxyTest
         Verifier verifier = newVerifier( testDir.getAbsolutePath() );
 
         Properties properties = verifier.newDefaultFilterProperties();
-        properties.setProperty( "@host@", 
InetAddress.getLocalHost().getCanonicalHostName() );
+        properties.setProperty( "@host@", 
InetAddress.getLoopbackAddress().getCanonicalHostName() );
         properties.setProperty( "@port@", Integer.toString( port ) );
         properties.setProperty( "@proxyPort@", Integer.toString( proxyPort ) );
         verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", 
properties );
diff --git 
a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4991NonProxyHostsTest.java
 
b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4991NonProxyHostsTest.java
index 47a4ad1..66d6ac2 100644
--- 
a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4991NonProxyHostsTest.java
+++ 
b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4991NonProxyHostsTest.java
@@ -93,7 +93,7 @@ public class MavenITmng4991NonProxyHostsTest
             filterProps.setProperty( "@port@", Integer.toString( port ) );
             int proxyPort = ( (NetworkConnector) proxy.getConnectors()[0] 
).getLocalPort();
             filterProps.setProperty( "@proxyPort@", Integer.toString( 
proxyPort ) );
-            filterProps.setProperty( "@localhost@", 
InetAddress.getLocalHost().getCanonicalHostName() );
+            filterProps.setProperty( "@localhost@", 
InetAddress.getLoopbackAddress().getCanonicalHostName() );
             verifier.filterFile( "settings-template.xml", "settings.xml", 
"UTF-8", filterProps );
             verifier.addCliOption( "-s" );
             verifier.addCliOption( "settings.xml" );

Reply via email to