Single unit test will not run

Issue #1125 resolved
Scott McClung created an issue

First off..big fan of IC! Thanks for all your work on it!

I'm running into the very same behavior described in issue#1109 multiple times a day for the last few days. It's happening on both my Mac and Windows machines on 3 completely different projects. It's not clear yet what the pattern is that starts the behavior, but I can be adding test methods and running them without issue for hours and then out of nowhere the next test method created just simply refuses to run. The runner just says Terminated. Running 'all tests' will execute, but it does not include the new test method in question. Running any other single test method will work fine.

I've attempted all the solutions mentioned in #1109 with inconsistent success. On one occasion updating the OST and invalidating the cache worked, on other occasions I had to go so far as to delete the project directory and re-clone it multiple times before it would work again. Attached are today's logs from the Mac with #com.illuminatedcloud.intellij.unittest.ApexUnitTestRunProcessHandler activated.
Running IC 2.0.3.7 and IDEA Ultimate 2018.2.4.

Comments (8)

  1. Scott Wells repo owner

    Thanks for the logs, Scott. I'm at Dreamforce so things are a bit hectic, but I'll definitely try to review them in a bit and provide feedback on what's going on. Hopefully it'll be pretty obvious from the logs. If not, I'll let you know what else I might need from you to help diagnose the issue.

  2. Scott Wells repo owner

    Scott, the main thing I'm seeing in here is that when the test run completes in Salesforce, I immediately see a stack trace like:

    java.lang.NullPointerException
        at com.intellij.notification.impl.IdeNotificationArea.updateStatus(IdeNotificationArea.java:109)
        at com.intellij.notification.impl.IdeNotificationArea.lambda$null$0(IdeNotificationArea.java:67)
        at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315)
        at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:447)
        at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:431)
        at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:415)
    

    The NPE is because the IDE can't find its status bar which is just bizarre. I'm going to log a support case with JetBrains to see if this is a known issue with a workaround/fix because it's a few levels of indirection away from what IC is doing in the plugin SDK's unit test framework. I'll keep you posted on what I find, but Nunzio may be correct that forcing IC to run tests async could provide a workaround. That uses a different path in the unit test framework that may avoid this issue. I'll be interested to know if that does help you or not.

  3. Scott Wells repo owner

    And I did log a support request with JetBrains on the topic. I'll let you know what I hear back from them.

  4. Scott Wells repo owner

    Issue tracker grooming. If this is still an issue, please feel free to reopen, ideally with a concrete reproduction scenario.

  5. Log in to comment