Maven build and maven-failsafe-plugin - The forked VM terminated without properly saying goodbye

前端 未结 6 2097
刺人心
刺人心 2020-12-18 22:19

I use Docker and https://github.com/fabric8io/docker-maven-plugin for my integration tests.

On my Windows 10 (after updating to Windows 10 1709) mac

相关标签:
6条回答
  • 2020-12-18 22:24

    I use the maven-surefire-plugin:2.22.1, but the forked VM still crashes. In my case the configuration forkedProcessExitTimeoutInSeconds for the maven-surefire-plugin helps. The default value are since maven-surefire-plugin:2.20.1 30 seconds. My project gots very time consuming test and so the forked JVM chrashes. Configure the plugin in the pom with the following property solves the problem.

    <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
                    <forkedProcessExitTimeoutInSeconds>120</forkedProcessExitTimeoutInSeconds>
            </configuration>
    </plugin>
    
    0 讨论(0)
  • 2020-12-18 22:27

    I'm also have error like that, related with forkstarter on the surefire plugin maybe you can try add this on your pom.xml

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <argLine>--add-modules java.base ${argLine} -Xmx1024m -XX:MaxPermSize=256m</argLine>
                    <forkCount>3</forkCount>
                    <reuseForks>true</reuseForks>
                </configuration>
            </plugin>
    

    Hope, this can help you

    0 讨论(0)
  • 2020-12-18 22:30

    Try out with Manven OPT parameter

    export MAVEN_OPTS="-Xms1024m -Xmx1G -XX:PermSize=1024m -noverify"

    0 讨论(0)
  • 2020-12-18 22:31

    I have the same problem and found three solutions which working for me:

    Problem description

    Problem is with maven plugin maven-surefire-plugin only in version 2.20.1 and 2.21.0. I checked and you use version 2.20.1.

    Solution 1

    Upgrade plugin version to 2.22.0. Add in pom.xml:

    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>2.22.0</version>
    </plugin>
    

    Solution 2

    Downgrade plugin version to 2.20. Add in pom.xml:

    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>2.20</version>
    </plugin>
    

    Solution 3

    Use plugin configuration testFailureIgnore. Add in pom.xml:

    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-plugin</artifactId>
      <configuration>
        <testFailureIgnore>true</testFailureIgnore>
      </configuration>
    </plugin>
    
    0 讨论(0)
  • 2020-12-18 22:37

    VM can crash because of many reasons. I am highlighting here one more cause it can crash.

    I was using maven-surefire-plugin version 2.22.0 with jvm config -Xmx2048m but still it was failing for me.

    Cause of failure: Accidentally I changed windows command prompt 'window buffer size' width to 2000 instead of changing the height. It causes the vm crashes in my case. When i ran the build using git bash it worked fine. So I able to figure out the issue and reverted the command prompt 'window buffer size' width to default value and it worked fine for me.

    Troubleshooting step:

    • Use different command tool to verify this issue. like window command prompt, git bash.
    0 讨论(0)
  • 2020-12-18 22:43

    I have version 2.22.2 and still get that error. I get pass this by setting the timeout for surefire. So the latest added tests added execution time to exceed the default 30 secs.

    mvn test -Dsurefire.exitTimeout=40
    

    default value for timeout is 30
    https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#forkedProcessExitTimeoutInSeconds

    <maven.surefire.plugin.version>2.22.2</maven.surefire.plugin.version>

    Edit: Actually the logging happening during the tests added up so much time to get timeout. So I changed logging levels.

    0 讨论(0)
提交回复
热议问题