【问题标题】:How to indentify tests that are failing with mvn test如何使用 mvn test 识别失败的测试
【发布时间】:2013-03-27 22:27:57
【问题描述】:

我已经设置了 maven 和 surefire 来运行单元测试。测试类被配置为并行运行;即类

有时当我运行“mvn test”时,一些测试会因超时而失败。但是,surefire 不会记录超时发生时正在运行的测试。它只记录已完成测试的详细信息。

超时似乎是某种死锁,并不总是重现。

当超时发生时,如何查明哪些测试正在运行?有没有办法改变 surefire 本身的日志级别,以便在从新类开始运行测试时转储一些消息?

我正在使用:Java:1.6,Maven:3.0.3,Surefire:2.14

【问题讨论】:

  • /target/surefire-reports下有测试结果...
  • target/surefire-reports 仅包含已完成测试的日志。如果“mvn test”由于超时而失败,它不会记录已启动但未完成的测试的详细信息。我看到的失败是:[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.14:test (default-test) on project : There was a timeout or other error在分叉中 -> [帮助 1]

标签: java maven-surefire-plugin


【解决方案1】:

在调试模式下执行测试

mvn -X 测试

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-08
    • 2020-06-08
    • 1970-01-01
    • 2023-01-14
    • 2019-07-31
    • 2016-12-09
    相关资源
    最近更新 更多