Intellij: Intellij hangs when running ignored Scalatests

Created on 28 Nov 2019  路  3Comments  路  Source: bazelbuild/intellij

Problem

When running test suites with ignored tests, Intellij hangs.

Demo:

https://github.com/KaoruDev/learning_bazel/blob/f4db41ca5c64f98a369ad9b67edf834cce2265b8/person/src/test/scala/com/kaoruk/PersonSpec.scala#L27-L29

Version information

IdeaUltimate: 2019.2.4
Platform: Mac OS X 10.14.6
Bazel plugin: 2019.11.14.0.1
Bazel: 1.2.1

IntelliJ scala testing bug

Most helpful comment

We just encountered the same problem, in an ignored test case using Scala's path.FreeSpec.

It looks like it could be fixed by using NO_ERROR instead of err.message, if err.message is null, in line 360 of https://github.com/bazelbuild/intellij/blame/master/base/src/com/google/idea/blaze/base/run/smrunner/BlazeXmlToTestEventsConverter.java.

path.FreeSpec's ignored syntax doesn't have a mechanism to specify an ignoreComment, as far as I can tell.

FYI @brendandouglas , as the author of this code

All 3 comments

I have this problem too.
Here's a stacktrace from IJ:

java.lang.reflect.InvocationTargetException
    at jdk.internal.reflect.GeneratedMethodAccessor106.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at com.intellij.execution.process.ProcessHandler$2.invoke(ProcessHandler.java:214)
    at com.sun.proxy.$Proxy22.processTerminated(Unknown Source)
    at com.intellij.execution.process.ProcessHandler.lambda$notifyTerminated$2(ProcessHandler.java:172)
    at com.intellij.execution.process.ProcessHandler$TasksRunner.execute(ProcessHandler.java:247)
    at com.intellij.execution.process.ProcessHandler.notifyTerminated(ProcessHandler.java:155)
    at com.intellij.execution.process.ProcessHandler.notifyProcessTerminated(ProcessHandler.java:151)
    at com.intellij.execution.process.KillableProcessHandler.notifyProcessTerminated(KillableProcessHandler.java:123)
    at com.intellij.execution.process.BaseProcessHandler.onOSProcessTerminated(BaseProcessHandler.java:61)
    at com.intellij.execution.process.OSProcessHandler.onOSProcessTerminated(OSProcessHandler.java:168)
    at com.intellij.execution.process.BaseOSProcessHandler$1.lambda$startNotified$0(BaseOSProcessHandler.java:99)
    at com.intellij.execution.process.ProcessWaitFor.lambda$null$0(ProcessWaitFor.java:61)
    at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:208)
    at com.intellij.execution.process.ProcessWaitFor.lambda$new$1(ProcessWaitFor.java:43)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalArgumentException: Argument for @NotNull parameter 'ignoreComment' of com/intellij/execution/testframework/sm/runner/events/TestIgnoredEvent.<init> must not be null
    at com.intellij.execution.testframework.sm.runner.events.TestIgnoredEvent.$$$reportNull$$$0(TestIgnoredEvent.java)
    at com.intellij.execution.testframework.sm.runner.events.TestIgnoredEvent.<init>(TestIgnoredEvent.java)
    at com.google.idea.blaze.base.run.smrunner.BlazeXmlToTestEventsConverter.processTestCase(BlazeXmlToTestEventsConverter.java:359)
    at com.google.idea.blaze.base.run.smrunner.BlazeXmlToTestEventsConverter.processTestSuite(BlazeXmlToTestEventsConverter.java:264)
    at com.google.idea.blaze.base.run.smrunner.BlazeXmlToTestEventsConverter.processTestSuite(BlazeXmlToTestEventsConverter.java:258)
    at com.google.idea.blaze.base.run.smrunner.BlazeXmlToTestEventsConverter.processParsedTestResults(BlazeXmlToTestEventsConverter.java:179)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
    at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1085)
    at com.google.idea.blaze.base.run.smrunner.BlazeXmlToTestEventsConverter.processAllTestResults(BlazeXmlToTestEventsConverter.java:114)
    at com.google.idea.blaze.base.run.smrunner.BlazeXmlToTestEventsConverter.flushBufferOnProcessTermination(BlazeXmlToTestEventsConverter.java:97)
    at com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil$2.processTerminated(SMTestRunnerConnectionUtil.java:206)
    ... 21 more

IdeaCommunity: 2019.2.4
Platform: Windows 10 10.0
Bazel plugin: 2020.01.14.0.1
Bazel: 2.0.0

We just encountered the same problem, in an ignored test case using Scala's path.FreeSpec.

It looks like it could be fixed by using NO_ERROR instead of err.message, if err.message is null, in line 360 of https://github.com/bazelbuild/intellij/blame/master/base/src/com/google/idea/blaze/base/run/smrunner/BlazeXmlToTestEventsConverter.java.

path.FreeSpec's ignored syntax doesn't have a mechanism to specify an ignoreComment, as far as I can tell.

FYI @brendandouglas , as the author of this code

Faced the same issue with "ignored" and also with "pending"
https://github.com/bazelbuild/intellij/issues/2662

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sambercovici picture sambercovici  路  9Comments

sundermann picture sundermann  路  5Comments

lifeiteng picture lifeiteng  路  4Comments

brandonpollack23 picture brandonpollack23  路  5Comments

KaoruDev picture KaoruDev  路  4Comments