Jacoco plugin incompatible with parallel test execution


(Steven Goris) #1

When I run my tests with maxParallelForks > 1, test coverage is inconsistent. I get a diffirent, wrong result on each run. It seems like the jacoco plugin does only record coverage for one of the test runners. I can also see this behaviour in the size of the exec file, so it is not related to the reporting but to the instrumentation.

Gradle Version: 2.14 & 2.14.1-rc-2
Operating System: Windows 7
Is this a regression? If yes, which version of Gradle do you know it last worked for? Unkown

(Paul Merlin) #2

Hi Steven,

I’ve tried to reproduce your issue and created a reproducer project: https://github.com/eskatos/gradle-jacoco-parallel

Everything works except when I set test.jacoco.append to false which makes sense.
When append is set to false, the last test runner wins and overwrite the jacoco exec output file.

Do you happen to set that property to false in your build?

(Steven Goris) #3

Yes I did, nice find… I thought that I had to set it to false for other reasons. I will try it out when I am back from my holiday, anyway thanks for your support!