Reg: Capturing method data for cases run parallelly

11 views
Skip to first unread message

Prabitha Susil

unread,
Mar 3, 2025, 11:13:38 PMMar 3
to jac...@googlegroups.com

Hi Team,

 

I am using jacoco for capturing the class and method level data that is being touched by my test case. I am currently doing this by serially running one case after other to capture the data. This is intern taking a lot of time.

Is it possible to run scripts / test cases parallelly capturing the data touched by each case separately.


Thanks,

Prabitha

Marc Hoffmann

unread,
Mar 4, 2025, 1:51:21 PMMar 4
to jac...@googlegroups.com
Hi Prabitha,

execution data is written in a global, shared store. If you run multiple test cases within the same JVM in parallel we cannot keep execution information apart.

The only option I see is to parallelize your tests in multiple JVMs.

Out of curiosity: Can you please share a bit about your use case? How are you processing and using the per-test coverage data?

Cheers,
-marc

--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/jacoco/CAMf5NwT%3DkQFOzHj%2BObQa-uKfUHcWBhLuxPh-8tMv4MMzkoGLoQ%40mail.gmail.com.

Rajeev Nandan

unread,
Mar 4, 2025, 10:08:28 PMMar 4
to jac...@googlegroups.com
Hi Marc, 

I had the same use case where i wanted to capture code coverage for each test case separately.

Our use case was to find duplicate tests in a service under test. Here a test case means one api call or kafka consumption to the service under test. 

We wrote a java agent which identifies end of a test case abd then export the coverage data to an exec file. But this approach works only if we are running test cases one by one.

Can we tweak usage of session id and use it as test case id to store coverage data separately?


Thanks and regards,
Rajeev Nandan

Prabitha Susil

unread,
Mar 7, 2025, 9:42:28 PMMar 7
to jac...@googlegroups.com
Thanks Marc for that confirmation. We use this data to run only test cases that would be impacted due to a particular transaction change on the application.

Marc Hoffmann

unread,
Mar 13, 2025, 12:10:51 PMMar 13
to jac...@googlegroups.com
Hi Rajeev,

it is not about the session id. It is about the execution data storage: JaCoCo probes are stored in static fields. We cannot distinguish between concurrent test runs as we don’t have separate storage for them.

Regard,
-marc

Reply all
Reply to author
Forward
0 new messages