java - maven-surefire-plugin 的 forkedProcessTimeoutInSeconds 的默认值是多少?

标签 java maven maven-surefire-plugin

forkedProcessTimeoutInSeconds 可以设置为 0,以防止 fork 测试虚拟机在指定时间后被假定为死亡。该属性的默认值是多少?

The documentation doesn't specify it ,NetBeans 中的 XML 自动完成显示 undefined ,这是没有意义的,因为只有将其设置为指定值或 0 才有意义。 A superficial look in the code表明该值必须在定义它的类之外设置。

弄清楚这一点并不是太重要,我更想确保我的 fork 过程正确并且可以提出改进建议。

最佳答案

因为 forkedProcessTimeoutInSeconds是一个原始 int ,它本身默认为 0。通过属性设置的任何值 > 0 都会导致 ForkClient设置该值的超时(以秒为单位)。

<forkedProcessTimeoutInSeconds>
Kill the forked test process after a certain number of seconds. If set to 0, wait forever for the process, never timing out.

来源:https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#forkedProcessTimeoutInSeconds

关于java - maven-surefire-plugin 的 forkedProcessTimeoutInSeconds 的默认值是多少?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45737977/

相关文章:

java - maven surefire : when are we forced to set reuseForks=false?

java - Spring Data REST - 当 PATCH 在请求正文中使用空数组发送时出现异常

java - Jersey 休息服务器 - 返回列表作为 json

maven - gradle - 无法从 maven repo 中找到依赖项

java - Maven插件: Modifying resources before packaging

java - 在 Maven 上按顺序强制进行集成参数化测试

java - 当尝试使用 java 访问 Elastic Search 时,得到空响应

java - "Chaining"两个 Controller ?

maven - 将参数从 'maven' 传递给 ant 任务

java - Docker->Maven->Failsafe->Surefire 启动 fork 失败,出现 "The forked VM terminated without properly saying goodbye. VM crash or System.exit called?"