AssertionFailedError分叉的Java VM因不存在的测试套件而异常退出 [英] AssertionFailedError Forked Java VM exited abnormally for non existing test suite
问题描述
This may look duplicate to something on SO however I have looked at this, this, this and this but have not found the solution that works.
我遇到的问题是,对于不存在的测试套件,我在jenkins上收到此错误.下面是jenkins ant生成日志中打印的错误;
The problem I have is I am getting this error on jenkins for non existing test suite. Below is the error printed in jenkins ant build log;
compile-tests-run:
[junit] Testsuite: com.smartstream.control.engine.validation.Batch-With-Multiple-Tests
[junit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec
[junit]
[junit] Testcase: null took 0 sec
[junit] Caused an ERROR
[junit] Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit.
[junit] junit.framework.AssertionFailedError: Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit.
[junit]
[junit] Running com.smartstream.control.engine.validation.Batch-With-Multiple-Tests
[junit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec
BUILD FAILED
u:\jenkins\workspace\control.unittests.execution.time.test\build\build.xml:256: The following error occurred while executing this line:
u:\jenkins\workspace\control.unittests.execution.time.test\engine\build\build.xml:287: Process fork failed.
Total time: 7 minutes 42 seconds
Build step 'Invoke Ant' marked build as failure
Archiving artifacts
Recording test results
[BFA] Scanning build for known causes...
[BFA] No failure causes found
[BFA] Done. 0s
Email was triggered for: Failure - Any
Sending email for trigger: Failure - Any
Sending email to: xxxxxxxx@abc.xom
Finished: FAILURE
现在您可以看到它似乎在com.smartstream.control.engine.validation.Batch-With-Multiple-Tests
上失败了,但是我在整个工作区中没有任何这样的测试套件.我什至在项目的任何地方都找不到它作为文字字符串.
now as you can see it seems to be failing on com.smartstream.control.engine.validation.Batch-With-Multiple-Tests
however I don't have any such test suite in my entire workspace. I couldn't even find it as a literal string anywhere in the project.
工作区中的以下搜索未返回任何内容;
The below search in the workspace returned nothing;
Windows findstr
均不显示;
neither did the windows findstr
;
我试图增加蚂蚁的构建记忆和permgen都无济于事.该版本使用Java 1.7.0_80-b15和ant 1.9.6运行.下面是engine/build.xml文件中的junit ant任务规范;
I have tried increasing the ant build memory and permgen to no avail. The build is running with java 1.7.0_80-b15 and ant 1.9.6. Below is the junit ant task specification in engine/build.xml file;
<junit dir="." haltonfailure="false" printsummary="yes" forkmode="once" fork="yes" showoutput="yes" failureproperty="tests.failed">
<classpath location="${build.testclasses}" />
<classpath location="${resources.dir}" />
<classpath location="${common.properties}" />
<classpath location="${common.libs}" />
<formatter type="xml" />
<formatter type="plain" usefile="false" />
<jvmarg value="-Demma.coverage.out.file=${build.coveragereport}/coverage.emma" />
<jvmarg value="-Demma.coverage.out.merge=true" />
<jvmarg value="-Xms512m" />
<jvmarg value="-Xmx1536m" />
<jvmarg value="-XX:MaxPermSize=512m" />
<jvmarg value="-XX:-UseSplitVerifier"/>
<batchtest todir="${build.report}">
<fileset dir="${test.dir}">
<include name="**/*Test.java" />
<exclude name="${excludeTestPattern1}" />
<exclude name="${excludeTestPattern2}" />
<exclude name="${excludeTestPattern3}" />
<exclude name="${excludeTestPattern4}" />
<exclude name="${excludeTestPattern5}" />
</fileset>
</batchtest>
</junit>
到目前为止我尝试过的事情
- 检查了詹金斯工作的
Delete workspace before build starts
以获得完整的构建版本. - 初始xmx为512m,我将其更新为1024m,然后更新为1536m
- 初始烫发大小为256m,已更新为512m
- 在蚂蚁任务中使用了
fork
和showoutput
属性 - 从最初的尝试中更新了Java和ant版本
- checked
Delete workspace before build starts
on jenkins job for a full clean build. - Initial xmx was 512m I updated it to be 1024m and then later 1536m
- Initial perm size was 256m, have updated to 512m
- have played around with
fork
andshowoutput
attributes in ant task - updated java and ant versions from initial try
任何帮助将不胜感激.
Any help would be greatly appreciated.
推荐答案
我找到了解决此问题的方法.我必须为ant启用详细日志记录,并通过该操作观察到以下堆栈跟踪;
I found a solution to this issue. I had to enable verbose logging for ant and through that the following stacktrace was observed;
Caused by: java.io.IOException: Cannot run program "u:\jenkins\tools\hudson.model.JDK\Java7\jre\bin\java.exe" (in directory "u:\jenkins\workspace\control.unittests.execution.time.test\engine"): CreateProcess error=206, The filename or extension is too long
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
at java.lang.Runtime.exec(Runtime.java:617)
at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:58)
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:428)
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:442)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeAsForked(JUnitTask.java:1257)
... 32 more
Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is too long
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:385)
at java.lang.ProcessImpl.start(ProcessImpl.java:136)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
... 37 more
由于jenkins根据构建作业名称创建工作区,因此太长时间以致无法通过它创建派生的vm.我更改了詹金斯的工作名称,并解决了该问题.
Since jenkins creates workspace based on the build job name it was too long to create forked vm through it. I changed the jenkins job name and it resolved the issue.
这篇关于AssertionFailedError分叉的Java VM因不存在的测试套件而异常退出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!