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 Join to answer
Community showcase
Emilee Spencer
Published Friday in Marketplace Apps

Marketplace Spotlight: DeepAffects

Hello Atlassian Community! My name is Emilee, and I’m a Product Marketing Manager for the Marketplace team. Starting with this post, I'm kicking off a monthly series of Spotlights to highlight Ma...

56 views 0 3
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot