随机测试用例失败 - Forked JVM 异常退出。

发布于 2024-12-26 01:22:44 字数 693 浏览 2 评论 0原文

我有一套 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寄风 2025-01-02 01:22:44

您仍然可以访问失败的 Hudson 构建的控制台日志吗?如果 JVM “意外”退出,您可能会发现 JVM 错误导致其崩溃,这不会出现在 JUnit 日志中(我假设您从中获得错误消息/堆栈跟踪),但可能会在 Ant 的输出中执行操作。

或者:

  • 您正在运行哪个版本的 Ant?我听说 Ant 1.7.1 之前的一个错误导致在某些情况下调用 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:

  • 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).
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文