Search code examples
javaselenium-webdrivertestngsurefire

Surefire 2.18v with testng, mave and selenium webdriver


I am getting issue with surefire 2.18v, it does not work properly and gives error. I was using surefire 2.6v however I was getting heap space issue with this version and hence I update to surefire 2.18v but with this also I am facing problem. I have tried searching on net but does not found proper input to resolve the problem. I am using eclipse for test project with Java 1.7, Maven, TestNg, TestNG report with selenium webdriver. Below is the error details

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25:23.563s
[INFO] Finished at: Fri Jan 23 18:37:38 IST 2015
[INFO] Final Memory: 12M/1013M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18:test (default-test) on project ProjectTest: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.18:test failed: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was cmd.exe /X /C ""D:\Program Files\Java\jdk1.7.0_67\jre\bin\java" -jar "D:\Automation\Java Project\ProjectTest\target\surefire\surefirebooter297839004395456325.jar" "D:\Automation\Java Project\ProjectTest\target\surefire\surefire7250122540039248955tmp" "D:\Automation\Java Project\ProjectTest\target\surefire\surefire_06252333885408211489tmp""
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

I would appreciate your inputs.

Thanks, Karim


Solution

  • Apache has this documented here. Please see whether this helps.

    Surefire fails with the message "The forked VM terminated without properly saying goodbye".

    Surefire does not support tests or any referenced libraries calling System.exit() at any time. If they do so, they are incompatible with Surefire and you should probably file an issue with the library/vendor. Alternatively the forked VM could also have crashed for a number of reasons. Look for the classical "hs_err*" files indicating VM crashes or examine the Maven log output when the tests execute. Some "extraordinary" output from crashing processes may be dumped to the console/log. If this happens on a CI environment and only after it runs for some time, there is a fair chance your test suite is leaking some kind of OS-level resource that makes things worse at every run. Regular OS-level monitoring tools may give you some indication.