JUnit tests pass in Eclipse but fail in Maven Surefire

前端 未结 17 1962
臣服心动
臣服心动 2020-11-29 17:28

I have written some JUnit tests using JUnit 4 and spring-test libraries. When I run the tests inside Eclipse then run fine and pass. But when I run them using Maven (during

17条回答
  •  春和景丽
    2020-11-29 17:57

    I suddenly experienced this error, and the solution for me was to disable to run tests in parallel.

    Your milage may vary, since I could lower number of failing tests by configuring surefire to run parallel tests by ´classes´.:

                
                    maven-surefire-plugin
                    2.7.2
                    
                        classes
                        10
                    
                
    

    As I wrote first, this was not enough for my test suite, so I completely disabled parallel by removing the section.

提交回复
热议问题