Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-2220

SurefireForkChannel#getForkNodeConnectionString() returns invalid URI string if localHost resolves to IPv6 address

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.2
    • 3.2.3
    • process forking
    • None

    Description

      SurefireForkChannel.getForkNodeConnectionString returns invalid URI string if localhost is an IPv6 address literal:

          public String getForkNodeConnectionString() {
              return "tcp://" + localHost + ":" + localPort + (isBlank(sessionId) ? "" : "?sessionId=" + sessionId);
          } 

      localHost is initialized from InetSocketAddress.getHostString() at SurefireForkChannel.SurefireForkChannel() which may return "... the String form of the address if it doesn't have a hostname (it was created using a literal)."

      If an IPv6 address is returned, then the URI computed is something like

      tcp://0:0:0:0:0:0:0:1:34398?sessionId=... 

      instead of required format (cf. URI.URI())

      tcp://[0:0:0:0:0:0:0:1]:34398?sessionId=...  

      At my end the incorrect URI seems to cause hanging build, probably when it is consumed at SurefireMasterProcessChannelProcessorFactory.connect().

      Attachments

        Issue Links

          Activity

            People

              michael-o Michael Osipov
              lne3 Lutz Neugebauer
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: