Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ: (Coverage): Error during class instrumentation: ... java.lang.ArrayIndexOutOfBoundsException

This affects both IntelliJ 2019.3 and 2020.1 (latest as of this post) Ultimate Editions.

Code coverage is missing for some classes, while other classes continue to show coverage. Stating the obvious, but the classes that do not show coverage data in fact should show it because those lines are hit by the tests.

Error that is seen is:

[2020.04.23 23:52:20] (Coverage): Error during class instrumentation: com.<redacted>: java.lang.ArrayIndexOutOfBoundsException: 113 [2020.04.23 23:52:20] (Coverage): Error during class instrumentation: com.<redacted>: java.lang.ArrayIndexOutOfBoundsException: 144 

Note that the redacted part is the actual fully qualified class path. The tests execute correctly, but the coverage data is missing.

I have ensured that the tests are set up for coverage correctly:

  • Coverage runner is IntelliJ IDEA
  • Packages and classes to include in coverage data are accurate

Does anybody know how to get past this so that the missing classes show coverage info?

like image 268
suvidya Avatar asked Apr 24 '20 07:04

suvidya


People also ask

How do I turn off IntelliJ coverage?

To disable code coverage highlighting In the IDEA IDE, on the Analyze menu, click Show Code Coverage Data, or use the Ctrl+Alt+F6 keyboard shortcut. In the Code Coverage Suites dialog, choose No coverage.

How do I check the code coverage of a test class in IntelliJ?

Coverage in the Coverage tool window If you want to reopen the Coverage tool window, select Run | Show Code Coverage Data from the main menu, or press Ctrl+Alt+F6 . The report shows the percentage of the code that has been executed or covered by tests. You can see the coverage result for classes, methods, and lines.


1 Answers

This seems to be the bug that is reported is IDEA-269838.

It is currently marked as resolved / fixed without specifying the version in which it is fixed. I think that means that the fix will be in Intellij IDEA 2021.3 which is due this month (November 2021) according to the JetBrains website.

like image 148
Stephen C Avatar answered Sep 22 '22 09:09

Stephen C