Since #49600 jl_write_coverage_data is no longer exported, making it inaccessible in Julia 1.10+. We recently started calling it (as ccall(:jl_write_coverage_data, Cvoid, (Ptr{Cvoid},), Base.JLOptions().output_code_coverage)) in our tests since we're using ReTestItems.jl which runs tests in multiple Julia processes in a parallel. Sometimes one of the test-running processes dies (e.g. we kill a worker on timeout or when the machine is getting too close to OOMing), at which point we lose the coverage information from it -- and our mitigation for that is calling jl_write_coverage_data after each test item. This seems to work well on 1.9 but is not currently compatible with 1.10 and onwards.
It would be great to have the option to generate coverage files eagerly on 1.10.
Since #49600
jl_write_coverage_datais no longer exported, making it inaccessible in Julia 1.10+. We recently started calling it (asccall(:jl_write_coverage_data, Cvoid, (Ptr{Cvoid},), Base.JLOptions().output_code_coverage)) in our tests since we're using ReTestItems.jl which runs tests in multiple Julia processes in a parallel. Sometimes one of the test-running processes dies (e.g. we kill a worker on timeout or when the machine is getting too close to OOMing), at which point we lose the coverage information from it -- and our mitigation for that is callingjl_write_coverage_dataafter each test item. This seems to work well on 1.9 but is not currently compatible with 1.10 and onwards.It would be great to have the option to generate coverage files eagerly on 1.10.