Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JUnit5IdeaTestRunner fails running unit tests

Tags:

android

junit5

Suddenly Android Studio can't run unit tests for one of my modules. I get the error:

Internal Error occurred. java.util.NoSuchElementException
at java.util.ArrayList$Itr.next(ArrayList.java:856)
at java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1042)
at com.intellij.junit5.JUnit5TestRunnerUtil.createSelector(JUnit5TestRunnerUtil.java:181)
at com.intellij.junit5.JUnit5TestRunnerUtil.buildRequest(JUnit5TestRunnerUtil.java:70)
at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:51)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

The only thing I need to know is whether this is a known issue.
Please notice that the unit tests of all the modules succeed if I run them in the external terminal or in the terminal in Android Studio or on the CI.
And if I run on Android Studio the same unit test configuration, changing only the module then everything works fine.

Please don't ask me to post the build.gradle files. Although it is likely that the problem is there, they are too big and more importantly if that is the problem, I wouldn't expect you to debug it.

like image 515
kingston Avatar asked May 02 '19 10:05

kingston


1 Answers

Reported here and here. Actually it's an issue in IntelliJ Idea. There are no workaround for now :(

like image 61
tewnn Avatar answered Nov 14 '22 23:11

tewnn