question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Code coverage crashes at runtime

See original GitHub issue

I was testing the new coverage support for scala3 with:

The latest version of sbt-scoverage https://github.com/scoverage/sbt-scoverage/tree/V2

with https://github.com/scoverage/sbt-scoverage/blob/V2/src/main/scala/scoverage/ScoverageSbtPlugin.scala#L162 set to 3.2.0-RC1-bin-SNAPSHOT

This call crashes with the instrumented code:

https://github.com/MasseGuillaume/porc-epic/blob/main/src/test/scala/porcEpic/unit/VisualizationTest.scala#L53

https://github.com/MasseGuillaume/porc-epic/blob/07157829817afd03d286f056f3c0dda3fd5e6eca/src/main/scala/porcEpic/Visualization.scala#L59-L80

Compiler version

latest (main branch)

Minimized code

import java.nio.file._
import java.io.File

extension (v: Int) {
  def save(): File = {
    Files.createTempDirectory("porc-epic").toFile
  }
}

1.save()

Output (click arrow to expand)

java.lang.ClassCastException: class scala.collection.immutable.ArraySeq$ofRef cannot be cast to class [Ljava.nio.file.attribute.FileAttribute; (scala.collection.immutable.ArraySeq$ofRef is in unnamed module of loader sbt.internal.ScalaLibraryClassLoader @53bcaacb; [Ljava.nio.file.attribute.FileAttribute; is in module java.base of loader 'bootstrap') at porcEpic.Visualization$package$.save(Visualization.scala:61) at porcEpic.unit.VisualizationTest.$init$$$anonfun$2(VisualizationTest.scala:91)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
smartercommented, Apr 30, 2022

This issue has a really high concentration of Guillaumes 😅

4reactions
MasseGuillaumecommented, May 1, 2022

This issue has a really high concentration of Guillaumes sweat_smile

Guillaume³ taking over the world.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xcode 11.4 - Crash when code cover… - Apple Developer
Based on the stack trace, there appears to be a crash occurring in the profiling runtime (which accumulates code coverage data during the...
Read more >
How to stop Code Coverage from crashing because of sinon ...
Issue: code coverage not working when sinon is a dependency. I currently have 3 test files. Running all the tests lead to 17...
Read more >
Troubleshooting Code Coverage - Visual Studio (Windows)
Explanation—Code coverage analysis is done while tests are running. It only includes assemblies that are loaded into memory when the tests run.
Read more >
Visual Studio 2019 crashes when 'Show code coverage ...
Visual Studio 2019 crashes when 'Show code coverage coloring" is clicked after running "Analyze Code Coverage For All Tests".
Read more >
Does Unit-Tested Code Crash? A Case Study of Eclipse - arXiv
Unit-testing, crash incident reports, code coverage, stack traces, software reliability. ∗Chioteli collected the unit testing results and performed the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found