CI failures in codecov processing

Recently, my CI jobs have been intermittently failing. My tests all pass but the failure arises from the codecov part of CI. There is no consistent pattern regarding which OS but (I think) it is always either nightly or pre.

Simply re-running the individual failed job almost always succeeds and, if not, a third run does.

19s
3s
4s
6m 3s
26s
Run julia-actions/julia-processcoverage@v1
Run julia --color=yes "$GITHUB_ACTION_PATH"/main.jl
  Activating new project at `~/.julia/environments/coveragetempenv`
   Resolving package versions...
   Installed CoverageTools ─ v1.4.1
   Installed JuliaSyntax ─── v1.0.2
    Updating `~/.julia/environments/coveragetempenv/Project.toml`
  [c36e975a] + CoverageTools v1.4.1
    Updating `~/.julia/environments/coveragetempenv/Manifest.toml`
  [c36e975a] + CoverageTools v1.4.1
  [70703baa] + JuliaSyntax v1.0.2
  [ade2ca70] + Dates v1.11.0
  [de0858da] + Printf v1.11.0
  [fa267f1f] + TOML v1.0.3
  [4ec0a83e] + Unicode v1.11.0
Precompiling project...
  13.2 s  ✓ JuliaSyntax
   0.7 s  ✓ CoverageTools
  2 dependencies successfully precompiled in 14 seconds. 4 already precompiled.
[ Info: CoverageTools.process_folder: Searching src for .jl files...
[ Info: CoverageTools.process_file: Detecting coverage for src/XLSX.jl
┌ Info: CoverageTools.process_cov: Coverage file(s) for src/XLSX.jl do not exist.
└ Assuming file has no coverage.
[ Info: CoverageTools.process_file: Detecting coverage for src/cell.jl
[ Info: CoverageTools.process_cov: processing src/cell.jl.4138.cov
[ Info: CoverageTools.process_file: Detecting coverage for src/cellformat-helpers.jl
[ Info: CoverageTools.process_cov: processing src/cellformat-helpers.jl.4138.cov
[ Info: CoverageTools.process_file: Detecting coverage for src/cellformats.jl
[ Info: CoverageTools.process_cov: processing src/cellformats.jl.4138.cov
[ Info: CoverageTools.process_file: Detecting coverage for src/cellref.jl
[ Info: CoverageTools.process_cov: processing src/cellref.jl.4138.cov
[ Info: CoverageTools.process_file: Detecting coverage for src/conditional-format-helpers.jl
[ Info: CoverageTools.process_cov: processing src/conditional-format-helpers.jl.4138.cov
[ Info: CoverageTools.process_file: Detecting coverage for src/conditional-formats.jl
[ Info: CoverageTools.process_cov: processing src/conditional-formats.jl.4138.cov
[ Info: CoverageTools.process_folder: Searching src/data for .jl files...
[ Info: CoverageTools.process_file: Detecting coverage for src/fileArray.jl
[ Info: CoverageTools.process_cov: processing src/fileArray.jl.4138.cov
[ Info: CoverageTools.process_file: Detecting coverage for src/formula.jl
[ Info: CoverageTools.process_cov: processing src/formula.jl.4138.cov
[ Info: CoverageTools.process_file: Detecting coverage for src/images.jl
[ Info: CoverageTools.process_cov: processing src/images.jl.4138.cov
[ Info: CoverageTools.process_file: Detecting coverage for src/read.jl
[ Info: CoverageTools.process_cov: processing src/read.jl.4138.cov
[ Info: CoverageTools.process_file: Detecting coverage for src/relationship.jl
[ Info: CoverageTools.process_cov: processing src/relationship.jl.4138.cov
[ Info: CoverageTools.process_file: Detecting coverage for src/sst.jl
[ Info: CoverageTools.process_cov: processing src/sst.jl.4138.cov
[ Info: CoverageTools.process_file: Detecting coverage for src/stream.jl
[ Info: CoverageTools.process_cov: processing src/stream.jl.4138.cov
[ Info: CoverageTools.process_file: Detecting coverage for src/styles.jl
[ Info: CoverageTools.process_cov: processing src/styles.jl.4138.cov
[ Info: CoverageTools.process_file: Detecting coverage for src/table.jl
[ Info: CoverageTools.process_cov: processing src/table.jl.4138.cov
[ Info: CoverageTools.process_file: Detecting coverage for src/tables_interface.jl
[ Info: CoverageTools.process_cov: processing src/tables_interface.jl.4138.cov
[ Info: CoverageTools.process_file: Detecting coverage for src/types.jl
[ Info: CoverageTools.process_cov: processing src/types.jl.4138.cov
[ Info: CoverageTools.process_file: Detecting coverage for src/workbook.jl
[ Info: CoverageTools.process_cov: processing src/workbook.jl.4138.cov
[ Info: CoverageTools.process_file: Detecting coverage for src/worksheet.jl
[ Info: CoverageTools.process_cov: processing src/worksheet.jl.4138.cov
[ Info: CoverageTools.process_file: Detecting coverage for src/write.jl
[ Info: CoverageTools.process_cov: processing src/write.jl.4138.cov
ERROR: LoadError: BoundsError: attempt to access empty String at index [1:9]
Stacktrace:
  [1] checkbounds(s::String, I::UnitRange{Int64})
    @ Base strings/basic.jl:212 [inlined]
  [2] getindex(s::String, r::UnitRange{Int64})
    @ Base strings/string.jl:585 [inlined]
  [3] process_cov(filename::String, folder::SubString{String})
    @ CoverageTools ~/.julia/packages/CoverageTools/K9SmF/src/CoverageTools.jl:188
  [4] process_file(filename::String, folder::SubString{String})
    @ CoverageTools ~/.julia/packages/CoverageTools/K9SmF/src/CoverageTools.jl:424
  [5] process_folder(folder::SubString{String})
    @ CoverageTools ~/.julia/packages/CoverageTools/K9SmF/src/CoverageTools.jl:450
  [6] _mapreduce(f::typeof(process_folder), op::typeof(vcat), ::IndexLinear, A::Vector{SubString{String}})
    @ Base reduce.jl:448
  [7] _mapreduce_dim(f::Function, op::Function, ::Base._InitialValue, A::Vector{SubString{String}}, ::Colon)
    @ Base reducedim.jl:337
  [8] mapreduce(f::Function, op::Function, A::Vector{SubString{String}}; dims::Colon, init::Base._InitialValue)
    @ Base reducedim.jl:329 [inlined]
  [9] top-level scope
    @ ~/work/_actions/julia-actions/julia-processcoverage/v1/main.jl:19
 [10] include(mod::Module, _path::String)
    @ Base Base.jl:325
 [11] exec_options(opts::Base.JLOptions)
    @ Base client.jl:355
 [12] _start()
    @ Base client.jl:596
in expression starting at /Users/runner/work/_actions/julia-actions/julia-processcoverage/v1/main.jl:19
Error: Process completed with exit code 1.

Have others experienced the same or is it just me? If the latter, can anyone suggest how I can avoid the issue?

Thanks!

Here is what claude says (abbreviated by me):

This is a known class of bug in CoverageTools.jl.

Fix: since coverage collection on nightly/pre isn’t actually meaningful , just stop letting that step fail your CI on those versions. Just skip coverage entirely off-stable:

      - uses: julia-actions/julia-processcoverage@v1
        if: matrix.version == '1'
      - uses: codecov/codecov-action@v7
        if: matrix.version == '1'
        with:
          files: lcov.info

This avoids wasting CI minutes generating lcov data you don’t upload anyway on the other three Julia versions. Given pre and nightly are already continue-on-error for build/test, this just extends that same tolerance to the coverage step, which is the one actually throwing here.

Is this actually good advice?

No that doesn’t make sense, if you are collecting coverage you probably want it for all the versions of julia being tested.

This looks like `process_cov` throws `BoundsError: attempt to access 8-codeunit String at index [1:9]` · Issue #70 · JuliaCI/CoverageTools.jl · GitHub