随机测试用例失败 - Forked JVM 异常退出. [英] Randomly test case fails - Forked JVM exits abnormally.
问题描述
我有一套 Junit 测试,每次在本地运行时都会通过.我已经设置了一个作业来运行该套件,hudson 使用 ANT 来调用测试.这个套件在 hudson 机器中传递了很长一段时间.但是从过去 3 天开始,一项测试失败了几次(随机).我们没有改变代码.错误是:
I have suite of Junit tests which passes every time I run locally. I have setup a job to run the suite, hudson uses ANT to invoke the tests.This suite was passing in the hudson machine for quite some time. But from last 3 days one test fails some times (randomly). And We have not changed to code. The error is :
错误信息
Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit.
堆栈跟踪
junit.framework.AssertionFailedError: Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit.
我在谷歌上找不到正确的答案.我检查了这里
I couldn't find proper answer on google. I checked here
但它似乎没有帮助.
哈德森机器详细信息:视窗 2003 服务器Java 1.6.0.29
Hudson machine details : Windows 2003 Server Java 1.6.0.29
推荐答案
您是否仍然可以访问失败的 Hudson 构建的控制台日志?如果 JVM 正在意外"退出,您可能会发现 JVM 错误导致它崩溃,这不会出现在 JUnit 日志中(我认为这是您从中获得错误消息/堆栈跟踪的地方),但可能会在 Ant 的输出中执行.
Do you still have access to the console log for the failed Hudson build? If the JVM is exiting 'unexpectedly' you may find a JVM bug is causing it to crash, which would not appear in the JUnit logs (which I assume is where you've got the error message/stack trace from), but probably would do in the output from Ant.
或者:
- 您运行的是哪个版本的 Ant?我听说过 Ant 1.7.1 之前的错误导致
System.exit()
在某些情况下被调用. - 您可能需要检查您的代码是否没有捕获任何不应该捕获的异常(例如
catch Throwable
).
- Which version of Ant are you running? I have heard of a bug pre-Ant 1.7.1 that caused
System.exit()
to be called under some circumstances. - You may want to check that your code is not catching any exceptions that it shouldn't be (e.g.
catch Throwable
).
这篇关于随机测试用例失败 - Forked JVM 异常退出.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!