简体   繁体   English

mvn 测试非常非常慢

[英]mvn test very very slow

I have ten Maven projects and for each project I have to perform a specific test case for n times (with n very large).我有十个 Maven 项目,对于每个项目,我必须执行特定的测试用例 n 次(n 非常大)。 To run the test case I run the command mvn -Dtest=className#methodName test , but it is extremely slow.要运行测试用例,我运行命令mvn -Dtest=className#methodName test ,但它非常慢。 I can't modify the project pom.我无法修改项目 pom。

Is there a faster command that works like the one written above?有没有像上面写的那样工作的更快的命令?

I found this command https://maven.apache.org/surefire/maven-surefire-plugin/examples/rerun-failing-tests.html , but it stops at the first success of the test.我发现这个命令https://maven.apache.org/surefire/maven-surefire-plugin/examples/rerun-failing-tests.html ,但它在测试第一次成功时停止。

Calling mvn -Dtest=className#methodName test multiples times is not a good idea because each time, all phases before test are executed before actually running the test. mvn -Dtest=className#methodName test调用mvn -Dtest=className#methodName test不是一个好主意,因为每次test之前的所有阶段都在实际运行测试之前执行。

If you really want to run the same test multiple times, try mvn -Dtest=className#methodName surefire:test .如果您真的想多次运行相同的测试,请尝试mvn -Dtest=className#methodName surefire:test But note that it would be better to dig into the tests to make sure they are deterministic instead of running each and every test a hundred times.但请注意,最好深入测试以确保它们是确定性的,而不是将每个测试运行一百次。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM