Christian Neverdal
Christian Neverdal

Reputation: 5385

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:

Upvotes: 7

Views: 15122

Answers (5)

Mustafa
Mustafa

Reputation: 11

In my case I fix this problem just changing webdrivermanager version 5.4.0 that it is

 <dependency>
    <groupId>io.github.bonigarcia</groupId>
    <artifactId>webdrivermanager</artifactId>
    <version>5.4.0</version>
</dependency>

Upvotes: 1

harnoor
harnoor

Reputation: 69

In my case it was due to a silly mistake, I did not add a static keyword on the method annotated with @BeforeAll.

Upvotes: 4

karl li
karl li

Reputation: 1496

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>

Upvotes: 1

ankursingh1000
ankursingh1000

Reputation: 1419

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.

Upvotes: 1

vikingsteve
vikingsteve

Reputation: 40438

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?

Upvotes: 1

Related Questions