Issue running jacocoagent in client mode

113 views
Skip to first unread message

lev....@gmail.com

unread,
Apr 26, 2018, 4:51:02 PM4/26/18
to JaCoCo and EclEmma Users
I am trying to set up jacocoagent in client mode, but having trouble making it send back the report data to the server. I am using the example ExecutionDataServer provided in the documentation here: https://www.jacoco.org/jacoco/trunk/doc/examples/java/ExecutionDataServer.java

I can see a Handler getting created once I start the service from which I am trying to get coverage data, so I believe the jacocoagent is connecting. But after the service finishes running, the jacoco.exec file is nearly blank. I have also tried to modify the server code to send a request to dump data, using
RemoteControlWriter.visitDumpCommand(true, false) after a delay; that did not work either. I have gotten a successful coverage report using tcpserver mode, but I would prefer to get the client mode to work since eventually I need to get report data from multiple micro-services. I am using maven, and currently running everything locally but eventually plan to move it to a docker cluster.

Marc Hoffmann

unread,
May 3, 2018, 3:05:31 AM5/3/18
to jac...@googlegroups.com
Hi,

by default the JaCoCo agent sends execution data at JVM shutdown only. A
proper shutdown sequence is required. If you e.g. simply kill the JVM it
has no chance to send execution data.

What is the exact content of the "nearly blank" exec file? You can
explore e.g. with the execinfo command from our command line tools:
https://www.jacoco.org/jacoco/trunk/doc/cli.html

Requesting exec data with RemoteControlWriter.visitDumpCommand(true,
false) should actually work. E.g. our integration with Eclipse works in
this mode.

Regards,
-marc
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages