Do tests run in parallel with the Clover-for-Maven instrument-test goal?

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.

1 answer

0 vote

Clover integration itself doesn't invoke any tests so if they run in parallel it's up to your Maven configuration. HoweverClover 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.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Stride

Get Started in Stride in 3 Easy Steps

Get started on Stride in 3 easy steps   If you’re new to Stride, welcome! We’re super excited to have you aboard. Stride is easy to use and set up, so don’t worry about reading tons of borin...

48 views 0 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you