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

SurefireForkChannel binds to wrong IP

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.0-M5
    • 3.0.0-M6
    • process forking
    • None

    Description

      I was really looking forward to the new TCP process communication (thanks for that!) but it seems it has a fundamental issue in non-trivial network setups:

      After adding:

      <forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
      

      my test executions are getting stuck at:

      [INFO] -------------------------------------------------------
      [INFO]  T E S T S
      [INFO] -------------------------------------------------------
      

      -X reveals:

      [INFO] -------------------------------------------------------
      [INFO]  T E S T S
      [INFO] -------------------------------------------------------
      [DEBUG] Determined Maven Process ID 15428
      [DEBUG] Fork Channel [1] connection string 'tcp://192.168.99.1:51401' for the implementation class org.apache.maven.plugin.surefire.extensions.SurefireForkChannel
      [DEBUG] boot classpath:  [omitted]
      [DEBUG] boot(compact) classpath:  [omitted]
      [DEBUG] Forking command line: cmd.exe /X /C "C:\Develop\some-project\middleware\_develop\java\default\bin\java -jar C:\Develop\Temp\surefire2701709940583667253\surefirebooter12465325576730119938.jar C:\Develop\Temp\surefire2701709940583667253 2020-06-18T17-33-41_288-jvmRun1 surefire6381289732609561853tmp surefire_02272472648642066547tmp"
      

      The problem here is that 192.168.99.1 is a IP of one of my VirtualBox Host-Only network adapters. So that won't work.
      From my naive perspective, I would have expected 127.0.0.1.

      I debugged the constructor of SurefireForkChannel and there Inet4Address.getLocalHost() is returning the wrong IP.
      At this point I am asking myself why SurefireForkChannel isn't simply using InetAddress.getLoopbackAddress() (which returns 127.0.0.1)?
      Alternatively a bindAddress parameter would come in handy.

      Attachments

        Issue Links

          Activity

            People

              tibordigana Tibor Digana
              famod Falko Modler
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: