I am diagnosing an issue with a continuous integration build of a Maven project. The Maven project uses the Clover-for-Maven plugin instrument-test goal in order to check code coverage and fail the build if the coverage is below a target value.
The Maven project runs both unit and integration tests during the Maven lifecycle "test" phase (I know it shouldn't but it does). The integration tests access a database. The integration tests are failing because of what looks like multiple tests reading and writing data to the database at the same time.
My investigation leads me to the following question. If my Maven project uses the instrument-test goal, will the Clover-for-Maven plugin create a new process for to do the code coverage check that might result in the integration tests being run twice and at the same time?
If it will do, I think that is likely to be the cause of the intermittent build failure.
Clover integration itself doesn't invoke any tests so if they run in parallel it's up to your Maven configuration. However, Clover instument mojo forks Maven lifecycle till install phase which I think might mean some of the phases (like test) may be executed twice.
I'm not sure if you have any parallel builds in your process but generally speaking Clover doesn't support parallel builds on any step of execution (instrumentation, test execution, report generation) and using {{-T}} parallel Maven builds with Clover is not recommended.
Hi Grzegorz. Thanks for the information. It is useful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.