Maven 故障安全性能?

发布于 2025-01-03 15:37:14 字数 1353 浏览 3 评论 0原文

我已经开始使用 Maven Failsafe 来正确实施集成测试。之前我使用 Surefire 运行所有测试。现在 Failsafe 运行 Surefire 不运行的功能。

运行“mvn clean verify”时,一切都会顺利进行,直到 Failsafe 运行为止。我不知道 Failsafe 的配置与 SureFire 有什么不同,但系统几乎立刻就停止了。变得几乎没有反应。它运行测试,但速度非常慢。

我正在使用 SureFire 的相同配置。我在这里缺少关于故障安全的特殊功能吗?线程?分叉?虫子?

显然它与 junit47 提供商有关。不使用时不会出现此行为。

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-failsafe-plugin</artifactId>
    <version>2.12</version>
    <dependencies>
      <dependency>
        <groupId>org.apache.maven.surefire</groupId>
        <artifactId>surefire-junit47</artifactId>
        <version>2.12</version>
      </dependency>
    </dependencies>
    <executions>
      <execution>
        <goals>
          <goal>integration-test</goal>
          <goal>verify</goal>
        </goals>
      </execution>
    </executions>
    <configuration>
      <argLine>-XX:+UseCompressedOops -Xmx2g</argLine>
      <includes>
        <include>com/foo/bar/**/*Test.class</include>
      </includes>
      <groups>com.foo.bar.testing.IntegrationTests</groups>
    </configuration>
  </plugin>

I've started with Maven Failsafe to implement integration tests properly. Previously I was running all tests with Surefire. Now Failsafe runs those Surefire isn't.

When running "mvn clean verify" everything goes well until it's time for Failsafe to run. I don't know in what the configuration of Failsafe differs from SureFire, but almost immediately the system grinds to a halt. Becomes almost non-responsive. It runs the tests, but very slowly.

I'm using the very same configuration of SureFire. Is there something special about Failsafe I'm missing here ? Threads ? Forking ? Bugs ?

Apparently it's related to the junit47 provider. This behavior doesn't appear when it is not used.

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-failsafe-plugin</artifactId>
    <version>2.12</version>
    <dependencies>
      <dependency>
        <groupId>org.apache.maven.surefire</groupId>
        <artifactId>surefire-junit47</artifactId>
        <version>2.12</version>
      </dependency>
    </dependencies>
    <executions>
      <execution>
        <goals>
          <goal>integration-test</goal>
          <goal>verify</goal>
        </goals>
      </execution>
    </executions>
    <configuration>
      <argLine>-XX:+UseCompressedOops -Xmx2g</argLine>
      <includes>
        <include>com/foo/bar/**/*Test.class</include>
      </includes>
      <groups>com.foo.bar.testing.IntegrationTests</groups>
    </configuration>
  </plugin>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文