我使用的是geb spock maven,ubuntu上的surefire 2.22.0版。直到两周前,它还可以正常工作,但突然我发现forked虚拟机没有恰当地说再见就终止了。虚拟机崩溃或系统崩溃。你叫出口吗 错误。以下是我的配置:
Maven Version: Apache Maven 3.6.0
Java version: openjdk version "1.8.0_181"
M3_HOME : /opt/maven
当我点击mvn-Dtest=“some test”test
命令时,它会抛出以下错误:
ExecutionException The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
Command was /bin/sh -c cd /home/web/workspace/Durgesh_Delete1 && /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -jar /home/web/workspace/Durgesh_Delete1/target/surefire/surefirebooter1782527278200611298.jar /home/web/workspace/Durgesh_Delete1/target/surefire 2018-11-16T11-10-54_226-jvmRun3 surefire2754275980317815656tmp surefire_01299389042676135686tmp
Error occurred in starting fork, check output in log
Process Exit Code: 1
下面是我完整的pom。xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.digital.web</groupId>
<artifactId>edge_bdd_automation</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<skipITTests>false</skipITTests>
<geb.version>2.1</geb.version>
<selenium.version>3.12.0</selenium.version>
<groovy.version>2.4.15</groovy.version>
<spock.version>1.1-groovy-2.4</spock.version>
<gson.version>2.8.2</gson.version>
<httpclient.version>4.3.4</httpclient.version>
<httpcore.version>4.3.2</httpcore.version>
<surefire.plugin.version>2.22.0</surefire.plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Groovy compiler for Spock/Geb tests -->
<version.groovy-eclipse-compiler>2.9.2-01</version.groovy-eclipse-compiler>
<version.groovy-eclipse-batch>2.4.3-01</version.groovy-eclipse-batch>
</properties>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>bintray</name>
<url>http://jcenter.bintray.com</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>bintray-plugins</name>
<url>http://jcenter.bintray.com</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>${spock.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.gebish</groupId>
<artifactId>geb-spock</artifactId>
<version>${geb.version}</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.gebish/geb-core -->
<dependency>
<groupId>org.gebish</groupId>
<artifactId>geb-core</artifactId>
<version>${geb.version}</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>${selenium.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
<!--<scope>test</scope>-->
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<!--Dependencies related to GEB SPOCK reporting-->
<dependency>
<groupId>com.athaydes</groupId>
<artifactId>spock-reports</artifactId>
<version>1.6.0</version>
<scope>test</scope>
<!-- this avoids affecting your version of Groovy/Spock -->
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>${groovy.version}</version>
</dependency>
<!-- // if you don't already have slf4j-api and an implementation of it in the classpath, add this! -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.25</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hamcrest/hamcrest-core -->
<!-- This dependency is for support of Junit latest version -->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/ru.yandex.qatools.ashot/ashot -->
<dependency>
<groupId>ru.yandex.qatools.ashot</groupId>
<artifactId>ashot</artifactId>
<version>1.5.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.codeborne/phantomjsdriver -->
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>1.4.4</version>
</dependency>
<!-- Geb - Spock Report -->
<dependency>
<groupId>com.aoe</groupId>
<artifactId>geb-spock-reports</artifactId>
<version>0.1.5</version>
<type>pom</type>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Maven surefire plugin-->
<!-- Uncommnet below for invoking parallel execution -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.plugin.version}</version>
<dependencies>
<!–SPOCK This is to force to use JUnit 4.7+ Runner –>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>${surefire.plugin.version}</version>
</dependency>
</dependencies>
<configuration>
<skipTests>${skipITTests}</skipTests>
<includes>
<include>*Spec.*</include>
</includes>
<systemPropertyVariables>
<geb.build.reportsDir>target/test-reports/geb</geb.build.reportsDir>
</systemPropertyVariables>
<parallel>classes</parallel>
<forkCount>5</forkCount>
<reuseForks>false</reuseForks>
<useUnlimitedThreads>true</useUnlimitedThreads>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<!-- IMPORTANT -->
<useIncrementalCompilation>false</useIncrementalCompilation>
<encoding>${project.build.sourceEncoding}</encoding>
<compilerId>groovy-eclipse-compiler</compilerId>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>${version.groovy-eclipse-compiler}</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>${version.groovy-eclipse-batch}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>${version.groovy-eclipse-compiler}</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
请关注这个问题。谢啦
最后,我可以通过在surefire插件的配置标签下添加以下行来解决这个问题:
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
<threadCount>1</threadCount>
</configuration>
拉什比在上述评论中提出的解决方案中提到了这一点,不幸的是,没有人投票支持这个答案,因此很难找到答案。谢谢
我写测试。我使用的是Cucumber 6.8.1、TestNG 7.0.0。为了并行化,我连接了maven-surefire-plugin2.22.2,但我现在没有并行测试,目前我只逐一运行所有测试。 大多数测试工作良好(大约45个测试)。但是有几个测试是有问题的,即:当运行这样的测试时,我得到错误“分叉的VM在没有正确地说再见的情况下终止了。VM崩溃或System.Exit调用?”以下是全文:
我已经配置了maven-surefire-plugin和jacoco插件来生成junit代码覆盖率报告。然而,我在两个不同的场景中得到了两个不同的错误。你能看看下面的错误并帮助我吗?任何帮助都是值得赞赏的。 当我在maven-surefire-plugin配置中将forkCount保持为0(零)时,所有测试都会成功执行,但不会生成jacoco报告。它给我的消息是“由于缺少执行数据文件,跳过JaCo
“分叉的虚拟机在没有正确说再见的情况下终止。虚拟机崩溃或系统调用退出?” 仅用一个分叉运行这个不会产生问题(并且一切都过去了) 有一些关于这个问题的信息,包括这个StackOverflow问题和这个bug(现在似乎已经解决了) 更新#1在使用--debug(-x)运行maven目标后添加相关的out put
问题内容: 我使用Docker和https://github.com/fabric8io/docker-maven- plugin 进行集成测试。 在Windows 10( 更新为Windows 10 1709 )上的计算机上,我的构建遇到以下错误: 现在我不知道可能出什么问题,我看不到测试有任何失败。 这个问题可能是什么原因以及如何解决? 更新 我的项目具有以下配置: 父母: 子模块: 如您所见
在运行单元测试时,出现以下异常: 有什么建议吗?
如标题所示:我正试图从集装箱化的詹金斯奴隶那里运行Maven自动化测试,在与此斗争了一周后,现在我已经没有想法了。它的工作原理是在AWS实例与4G的RAM,但在不受限制的(在RAM和CPU)容器,它失败与错误如下。当它运行的唯一情况是当我禁用分叉故障安全插件,但这不是一个选项前进。 我尝试了各种Java /Maven/Failsafe/Surefire选项,我可以用谷歌找到,但没有运气(如添加全局