随机测试用例失败 - Forked JVM 异常退出。
我有一套 Junit 测试,每次在本地运行时都会通过。我已经设置了一个作业来运行该套件,hudson 使用 ANT 来调用测试。该套件在 hudson 机器中传递了相当长的一段时间。但从过去 3 天开始,一项测试有时会失败(随机)。而且我们还没有更改代码。错误是:
错误消息
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.
我在谷歌上找不到正确的答案。我检查了此处
但似乎没有帮助。
哈德森机器详细信息: Windows 2003 服务器 Java 1.6.0.29
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 :
Error Message
Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit.
Stacktrace
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
but it doesn't seem to help.
Hudson machine details :
Windows 2003 Server
Java 1.6.0.29
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您仍然可以访问失败的 Hudson 构建的控制台日志吗?如果 JVM “意外”退出,您可能会发现 JVM 错误导致其崩溃,这不会出现在 JUnit 日志中(我假设您从中获得错误消息/堆栈跟踪),但可能会在 Ant 的输出中执行操作。
或者:
System.exit()
。catch Throwable
)。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.
Alternatively:
System.exit()
to be called under some circumstances.catch Throwable
).