const buf = new Buffer([0x01,0xc0,0xc0,0x10,0x07]);
// block header
this.write(buf);
// BLOCK_CMDDUMP 64 = 0x40
const buf2 = new Buffer(1);
buf2.writeInt8(64);
this.write(buf2);
//Dump flag and reset flag (both true)
buf3 = new Buffer([0x01,0x01]);
this.write(buf3);
agents[i].client.on('data', function(data) {
//only write execution data if there actually is data to write (avoid empty files)
if (data && data.toString().trim() != "" ) {
mkpath.sync('executionData', 0700);
fs.appendFileSync('executionData/'+ this.logFileId +'.exec', data.toString());
}
this.end();
});
The binary data written to the log file at a glance looks ok to me and similar to what the maven and ant tasks output. But upon trying to generate a report from the data the java code complains that it is invalid.
I'm hoping someone here is an expert on the format of the execution data and can see something I've done wrong... or might point me towards a spec on the exeecution data so I can validate it somehow.
> fs.appendFileSync('executionData/'+ this.logFileId +'.exec', data);
and the and merge now gets through some of the files before complaining.
The stack trace is:
Unable to read /var/lib/go-agent/pipelines/Acceptance-Tests-With-Coverage/tests/executionData/1462927504650_6901.exec
at org.jacoco.ant.MergeTask.load(MergeTask.java:87)
at org.jacoco.ant.MergeTask.execute(MergeTask.java:67)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.io.IOException: Unknown block type 20.
at org.jacoco.core.data.ExecutionDataReader.readBlock(ExecutionDataReader.java:119)
at org.jacoco.core.data.ExecutionDataReader.read(ExecutionDataReader.java:90)
at org.jacoco.core.tools.ExecFileLoader.load(ExecFileLoader.java:59)
at org.jacoco.ant.MergeTask.load(MergeTask.java:85)
... 17 more
I see old mentions of concurrency issues on google, but these files are written synchronously in a single thread, so that should not be the issue here.