maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [maven-integration-testing] joakime commented on a change in pull request #46: [MNG-6731] Jetty getLocalPort() returns -1 resulting in build failures
Date Thu, 15 Aug 2019 12:24:42 GMT
joakime commented on a change in pull request #46: [MNG-6731] Jetty getLocalPort() returns
-1 resulting in build failures
URL: https://github.com/apache/maven-integration-testing/pull/46#discussion_r314284534
 
 

 ##########
 File path: core-it-suite/src/test/java/org/apache/maven/it/MavenIT0146InstallerSnapshotNaming.java
 ##########
 @@ -59,15 +60,11 @@ protected void setUp()
         server = new Server( 0 );
         server.setHandler( handlers );
         server.start();
-        while ( !server.isRunning() || !server.isStarted() )
+        if ( server.isFailed() )
         {
-            if ( server.isFailed() )
-            {
-                fail( "Couldn't bind the server socket to a free port!" );
-            }
-            Thread.sleep( 100L );
+            fail( "Couldn't bind the server socket to a free port!" );
         }
-        port = server.getConnectors()[0].getLocalPort();
+        port = ( (NetworkConnector) server.getConnectors()[0] ).getLocalPort();
 
 Review comment:
   There's also `server.getURI().getPort()` as a valid option here.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message