JUnit运行60分钟后超时
我有一个驻留在另一个项目中的实际代码的测试项目。 例如,如果存在具有与功能相关的所有代码的FunctionalModule,我就有一个测试项目FunctionalModuleTest。
我的 ant 运行 FuntionalModuleTest 中的测试,并测试 FuntionalModule 项目中的代码。
有很多测试用例,60 分钟后,运行停止并显示错误消息 - “以下测试项目因运行超过超时(60 分钟)而被终止。
在哪里配置的?我的 ant 和 emma 没有配置超时。它不在项目属性中。我想要一种方法来覆盖此配置并保持超时添加
更多信息:2011 年 11 月 22 日
我正在使用 ANT 1.7.0,Unbreakable linux [Linux ME 2.6.18-164.0.0.0.1.el5 #1 SMP 9 月 3 日星期四 00:21:28 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux],Java 与 OracleDB
I have a test project for my actual code that resides in another project.
for example, if there is FunctionalModule that has all the code concerning the functionality, I have a test project FunctionalModuleTest.
My ant runs the tests from FuntionalModuleTest and code in the FuntionalModule project is tested.
There are many test cases and after 60 mins, the run halts with an error message -
"The following TestProjects were killed for running past the timeout (60mins).
Where is this configured? My ant and emma does not have the timeout configured. It is not in project properties. I want a way to override this config and keep the timeout unbounded.
Adding more information : Nov 22 2011
I am using ANT 1.7.0, Unbreakable linux [Linux ME 2.6.18-164.0.0.0.1.el5 #1 SMP Thu Sep 3 00:21:28 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux], Java with OracleDB
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是什么导致您的测试花费这么长时间?您可能希望将测试套件分解为单元测试(应该很快)和集成/系统测试(可能很慢)。在延长超时时间之前,我会考虑加快测试速度。
这个 Nabble 线程 似乎表明它是您的
TestRunner
,不是 Junit。如果要为所有测试设置全局最大值,可以查看 JUnit 中的 Timeout 类 或 测试的元素注释What is causing your tests to take so long? You may want to break up your test suite into unit test (should be fast) and integration/system tests (can be slow). I would look at speeding up your tests before expanding the timeout.
This Nabble Thread seems to indicate it's your
TestRunner
, not Junit. If you want to set a global max for all tests, you can look at The Timeout class in JUnit or The elements for the Test Annotation嗯,默认的 60 分钟超时是由 ANT 设置的。
要改变它,或者覆盖该属性,
必须添加命令行属性:(4 小时)。
Well, the default 60 min timeout is set by ANT.
And to alter that, or to override that property, a command line property:
(4 hrs) has to be added.