IntelliJ - Failed to start: 0 passed, 1 not starte

2019-01-25 07:26发布

Just been playing around for the first time with IntelliJ IDEA Community edition, first time I have worked with it so if I'm missing something, please excuse me.

I have a bunch of unit tests which I run, however, when running them in IntelliJ (with the standard setup out of the box), I intermittently get the following error in the console:

03:14:17 Failed to start: 58 passed, 1 not started

I have searched the web but to no avail. If I run just the test that failed, it may or may not print out a similar error:

03:19:54 Failed to start: 0 passed, 1 not started

If I keep trying, eventually it works and tells me that all of my tests have passed.

The image is not the error as an exclamation mark, it is a different error icon (error icon), which I do not recognise. The error in Event Log window appears as red text.

It always appears to happen with only one test and it is always the same test for any given set of tests. I.E. In a different project, the same issue also appears, but for a different test (but its always the same one in each project or set of tests).

One more thing to note is that this ONLY happens when debugging and not when running, so it may be something to do with connecting the debugger?

It all works perfectly fine with Eclipse.

Any ideas what could be causing this?

Many thanks!

6条回答
别忘想泡老子
2楼-- · 2019-01-25 07:30

Looks like this may have been a bug on IntelliJ, it has been raised with them.

查看更多
我想做一个坏孩纸
3楼-- · 2019-01-25 07:43

I've created a ticket for IntelliJ IDEA, you can vote for it if you still encounter this problem.

查看更多
甜甜的少女心
4楼-- · 2019-01-25 07:49

I had this problem (in Android Studio but its a customised IntelliJ) and the reason was WHERE the cursor was when I ran tests using CTRL-SHIFT-F10.

@Parameterized.Parameters
public static Collection data()

Once I moved the cursor into a test method or not inside any method, it worked.

查看更多
聊天终结者
5楼-- · 2019-01-25 07:49

I had the same issue that cracked me up a little in IntelliJ IDEA 2017.2.1. The test case ran without any recognizable errors or irregularities, but in the end JUnit claimed the case as not started.

Figured out it was caused by trying to print into a PrintWriter that has already been closed.

查看更多
Emotional °昔
6楼-- · 2019-01-25 07:51

I had the same issue. Whatever be the number of scenarios, it was showing 1 extra scenario in NOT STARTED stage. I was using Scenario Outline to run tests and had commented the rows in the Example tables.

I later found out that commenting the whole example table (which I didn't wanted to run) resolved the issue rather than commenting each row.

查看更多
该账号已被封号
7楼-- · 2019-01-25 07:54

I got the same error. It was something weird sent to System.out that made IntellJ IDEA test "not started".

查看更多
登录 后发表回答