Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ: Tests not started

I'm running a lot of JUnit tests in parallel, and I frequently get results along the lines of "N tests passed, M tests failed, P tests not started" (in contrast to this question, where no tests start at all).

What can cause this? I tried the "invalidate cache" option, however, this does not appear to solve anything. I should mention that tests take a while longer to run than the average JUnit tests (they can take up to 90 seconds to run), could this have anything to do with it? Right now I simply press "rerun failed tests" until I have forced IntelliJ do run all of them, which is rather cumbersome. I'm not sending anything weird to System.out either, and as I've stated I do get them to run eventually.

It runs tests for about ten minutes, and then no further tests are started. Is there a timeout of some kind somewhere that I can't find?

Sometimes this appears in the console after this happens:

Process finished with exit code 255

Version details:

  • IntelliJ version 13.1.4
  • JUnit 4.10
like image 914
Christian Neverdal Avatar asked Oct 03 '14 10:10

Christian Neverdal


3 Answers

There is a timeout option for the @Test annotation - have you tried increasing that?

And there is also a @Rule and Timeout option.

Info about Timeout for Tests - I hope it is relevant?

like image 178
vikingsteve Avatar answered Sep 28 '22 17:09

vikingsteve


I faced the same problem. Solved by adding test platform in build.gradle.

test {
useJUnitPlatform()
}

Restart intelij by removing all modules and adding them again.

like image 42
ankursingh1000 Avatar answered Sep 28 '22 18:09

ankursingh1000


In my case, I resolved this issue by fixing some dependencies issue.

In my root pom.xml, I added this:

<dependency>
  <groupId>org.junit.jupiter</groupId>
  <artifactId>junit-jupiter-engine</artifactId>
  <version>5.1.0</version>
  <scope>test</scope>
</dependency>

and in my module, I added this:

<dependency>
  <groupId>org.junit.jupiter</groupId>
  <artifactId>junit-jupiter-engine</artifactId>
  <scope>test</scope>
</dependency>

and removed the old one:

<dependency>
  <groupId>org.junit.jupiter</groupId>
  <artifactId>junit-jupiter</artifactId>
  <version>RELEASE</version>
  <scope>test</scope>
</dependency>
like image 36
karl li Avatar answered Sep 28 '22 17:09

karl li