maven - fail build when unit test takes too long

后端 未结 6 2116
广开言路
广开言路 2021-02-12 20:22

I have in my project a lot of unit tests, written in JUnit and TestNG. The building process is based on maven with surefire plugin.

Is there any way/plugin for maven to

6条回答
  •  执笔经年
    2021-02-12 21:06

    In maven surefire, you can use forkedProcessTimeoutInSeconds, along with forkMode=once.

    This will kill the forked jvm if it takes too long. If you want to do this per test, you can forkMode=pertest or forkMode=always (which does it for each class).

提交回复
热议问题