Attempting to show Code Coverage goes into infinite loop

Issue #686 resolved
Ivaylo Hristakiev created an issue

I am trying to show code coverage for my apex classes. Doing Analyze > Show Code Coverage goes into an infinite loop of Retrieving + Preparing coverage data. See the log below.

2017-08-15 16:52:07,716 [ 133032]  ERROR - intellij.openapi.progress.Task - IntelliJ IDEA 2017.2.1  Build #IU-172.3544.35 
2017-08-15 16:52:07,717 [ 133033]  ERROR - intellij.openapi.progress.Task - JDK: 1.8.0_152-release 
2017-08-15 16:52:07,717 [ 133033]  ERROR - intellij.openapi.progress.Task - VM: OpenJDK 64-Bit Server VM 
2017-08-15 16:52:07,717 [ 133033]  ERROR - intellij.openapi.progress.Task - Vendor: JetBrains s.r.o 
2017-08-15 16:52:07,717 [ 133033]  ERROR - intellij.openapi.progress.Task - OS: Mac OS X 
2017-08-15 16:52:07,717 [ 133033]  ERROR - intellij.openapi.progress.Task - Last Action: SwitchCoverage 
2017-08-15 16:52:09,552 [ 134868]   WARN - lij.coverage.ApexCoverageSuite - No uncovered line details found in coverage response for ErpMessageBuilders when lines uncovered = 60. Adding all executable lines that were not reported as covered as uncovered. 
[similar log lines removed]

2017-08-15 16:52:09,660 [ 134976]  ERROR - intellij.openapi.progress.Task - null 
java.lang.StackOverflowError
    at com.intellij.openapi.util.UserDataHolderBase.getUserData(UserDataHolderBase.java:61)
    at com.intellij.psi.impl.source.resolve.FileContextUtil.getFileContext(FileContextUtil.java:36)
    at com.intellij.psi.impl.source.PsiFileImpl.getContext(PsiFileImpl.java:620)
    at com.intellij.psi.impl.source.PsiFileImpl.getModificationStamp(PsiFileImpl.java:408)
    at com.intellij.psi.impl.PsiCachedValue.getTimeStamp(PsiCachedValue.java:88)
    at com.intellij.util.CachedValueBase.isDependencyOutOfDate(CachedValueBase.java:138)
    at com.intellij.psi.impl.PsiCachedValue.isDependencyOutOfDate(PsiCachedValue.java:74)
    at com.intellij.util.CachedValueBase.isUpToDate(CachedValueBase.java:128)
    at com.intellij.psi.impl.PsiCachedValue.isUpToDate(PsiCachedValue.java:65)
    at com.intellij.util.CachedValueBase.a(CachedValueBase.java:107)
    at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:214)
    at com.intellij.psi.impl.PsiCachedValue.getValueWithLock(PsiCachedValue.java:60)
    at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:38)
    at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:136)
    at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:126)
    at com.illuminatedcloud.intellij.psi.impl.ApexClassDeclarationMixin.getBaseClassDeclaration(SourceFile:195)
    at com.illuminatedcloud.intellij.psi.impl.ApexClassDeclarationMixin.getAllImplementedTypeDeclarations(SourceFile:301)
    at 
[duplicate lines removed]

2017-08-15 16:52:09,668 [ 134984]  ERROR - intellij.openapi.progress.Task - IntelliJ IDEA 2017.2.1  Build #IU-172.3544.35 
2017-08-15 16:52:09,669 [ 134985]  ERROR - intellij.openapi.progress.Task - JDK: 1.8.0_152-release 
2017-08-15 16:52:09,669 [ 134985]  ERROR - intellij.openapi.progress.Task - VM: OpenJDK 64-Bit Server VM 
2017-08-15 16:52:09,669 [ 134985]  ERROR - intellij.openapi.progress.Task - Vendor: JetBrains s.r.o 
2017-08-15 16:52:09,669 [ 134985]  ERROR - intellij.openapi.progress.Task - OS: Mac OS X 
2017-08-15 16:52:09,669 [ 134985]  ERROR - intellij.openapi.progress.Task - Last Action: SwitchCoverage 
2017-08-15 16:52:11,990 [ 137306]   WARN - lij.coverage.ApexCoverageSuite - No uncovered line details found in coverage response for ErpMessageBuilders when lines uncovered = 60. Adding all executable lines that were not reported as covered as uncovered. 
[similar log lines removed]

Comments (25)

  1. Scott Wells repo owner

    Apologies for the issue. I know a few others have reported this as well and I've had a hard time tracking it down. Hopefully with the info you've provided here I'll finally be able to resolve it!

  2. Ivaylo Hristakiev reporter

    Thanks for the quick response!

    Let me know if any data is needed.

    Code coverage seemed to work a few days ago, can't recall if/when I did anything relevant to break it (it broke before the latest IC upgrade). Maybe I disabled the Coverage plugin at some point.

  3. Mike Wannamaker

    I got something similar when running tests with code coverage. Hope it helps.

    2017-09-06 15:45:58,372 [1824109169] WARN - lij.coverage.ApexCoverageSuite - No uncovered line details found in coverage response for SoqlCompositeCondition when lines uncovered = 61. Adding all executable lines that were not reported as covered as uncovered. 2017-09-06 15:45:58,372 [1824109169] WARN - .intellij.psi.util.ApexPsiUtil - Attempting to add an invalid element as a cache dependency: class com.illuminatedcloud.intellij.psi.impl.ApexClassDeclarationImpl 2017-09-06 15:45:58,372 [1824109169] WARN - .IlluminatedCloudExceptionUtil - Element class com.intellij.psi.impl.source.tree.CompositeElement of type CLASS_DECLARATION (class com.illuminatedcloud.intellij.psi.stub.ApexClassDeclarationElementType) com.intellij.psi.PsiInvalidElementAccessException: Element class com.intellij.psi.impl.source.tree.CompositeElement of type CLASS_DECLARATION (class com.illuminatedcloud.intellij.psi.stub.ApexClassDeclarationElementType) at com.intellij.psi.PsiInvalidElementAccessException.createByNode(PsiInvalidElementAccessException.java:96) at com.intellij.psi.impl.source.SubstrateRef$2.getContainingFile(SubstrateRef.java:101) at com.intellij.extapi.psi.StubBasedPsiElementBase.getContainingFile(StubBasedPsiElementBase.java:275) at com.intellij.psi.util.PsiUtilCore.getVirtualFile(PsiUtilCore.java:376) at com.illuminatedcloud.intellij.psi.util.ApexPsiUtil.getVirtualFile(SourceFile:706) at com.illuminatedcloud.intellij.psi.util.ApexPsiUtil.findModuleForPsiElement(SourceFile:762) at com.illuminatedcloud.intellij.psi.util.ApexPsiUtil.getCacheDependencies(SourceFile:847) at com.illuminatedcloud.intellij.psi.impl.ApexDeclarationMixin$2.compute(SourceFile:139) at com.intellij.psi.util.CachedValuesManager.lambda$getCachedValue$0(CachedValuesManager.java:140) at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:49) at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:222) at com.intellij.psi.impl.PsiCachedValue.getValueWithLock(PsiCachedValue.java:60) at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:38) at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:136) at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:126) at com.illuminatedcloud.intellij.psi.impl.ApexDeclarationMixin.getExpressionType(SourceFile:132) at com.illuminatedcloud.intellij.psi.impl.ApexInvokableDeclarationMixin.getSignature(SourceFile:58) at com.illuminatedcloud.intellij.psi.stub.ApexInvokableDeclarationStub.<init>(SourceFile:27) at com.illuminatedcloud.intellij.psi.stub.ApexMethodDeclarationStub.<init>(SourceFile:26) at com.illuminatedcloud.intellij.psi.stub.ApexMethodDeclarationElementType.doCreateStub(SourceFile:35) at com.illuminatedcloud.intellij.psi.stub.ApexMethodDeclarationElementType.doCreateStub(SourceFile:19) at com.illuminatedcloud.intellij.psi.stub.ApexDeclarationStubElementType.createStub(SourceFile:164) at com.illuminatedcloud.intellij.psi.stub.ApexDeclarationStubElementType.createStub(SourceFile:32) at com.intellij.psi.stubs.DefaultStubBuilder$StubBuildingWalkingVisitor.a(DefaultStubBuilder.java:113) at com.intellij.psi.stubs.DefaultStubBuilder$StubBuildingWalkingVisitor.visitNode(DefaultStubBuilder.java:88) at com.intellij.psi.stubs.DefaultStubBuilder$StubBuildingWalkingVisitor.buildStubTree(DefaultStubBuilder.java:83) at com.intellij.psi.stubs.DefaultStubBuilder.buildStubTreeFor(DefaultStubBuilder.java:58) at com.intellij.psi.stubs.DefaultStubBuilder.buildStubTree(DefaultStubBuilder.java:39) at com.intellij.psi.impl.source.PsiFileImpl.calcStubTree(PsiFileImpl.java:1085) at com.intellij.psi.stubs.StubProcessingHelperBase.processStubsInFile(StubProcessingHelperBase.java:77) at com.intellij.psi.stubs.StubProcessingHelperBase.processStubsInFile(StubProcessingHelperBase.java:53) at com.intellij.psi.stubs.StubIndexImpl$2.process(StubIndexImpl.java:331) at com.intellij.psi.stubs.StubIndexImpl$StubIdListContainerAction.perform(StubIndexImpl.java:617) at com.intellij.psi.stubs.StubIndexImpl$StubIdListContainerAction.perform(StubIndexImpl.java:605) at com.intellij.util.indexing.ValueContainer.forEach(ValueContainer.java:62) at com.intellij.psi.stubs.StubIndexImpl.a(StubIndexImpl.java:360) at com.intellij.psi.stubs.StubIndexImpl.processElements(StubIndexImpl.java:323) at com.intellij.psi.stubs.StubIndexImpl.processElements(StubIndexImpl.java:312) at com.intellij.psi.stubs.StubIndex.process(StubIndex.java:76) at com.intellij.psi.stubs.StubIndex.process(StubIndex.java:95) at com.intellij.psi.stubs.StubIndexImpl.get(StubIndexImpl.java:301) at com.intellij.psi.stubs.StubIndexImpl.get(StubIndexImpl.java:291) at com.intellij.psi.stubs.AbstractStubIndex.get(AbstractStubIndex.java:39) at com.illuminatedcloud.intellij.index.AbstractApexDeclarationStubIndex.get(SourceFile:28) at com.illuminatedcloud.intellij.psi.util.ApexDeclarationUtil.fastFindTypeDeclaration(SourceFile:272) at com.illuminatedcloud.intellij.psi.util.ApexDeclarationUtil.findTypeDeclaration(SourceFile:254) at com.illuminatedcloud.intellij.coverage.ApexCoverageEngine$5.compute(SourceFile:546) at com.illuminatedcloud.intellij.coverage.ApexCoverageEngine$5.compute(SourceFile:542) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:954) at com.illuminatedcloud.intellij.coverage.ApexCoverageEngine.findClassOrTriggerDeclaration(SourceFile:541) at com.illuminatedcloud.intellij.coverage.ApexCoverageSuite$2.run(SourceFile:414) at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:718) at com.intellij.openapi.progress.impl.CoreProgressManager$5.run(CoreProgressManager.java:402) at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:170) at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:548) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:493) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:157) at com.intellij.openapi.application.impl.ApplicationImpl.a(ApplicationImpl.java:603) at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:343) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

  4. Scott Wells repo owner

    I'm hoping I resolved this in a recent build. I think it was happening because coverage was being displayed while IntelliJ was updating indices, and it was causing endless re-entrancy. If you still see it on current builds please reopen and provide a log.

  5. Scott Wells repo owner

    Sorry for the recurrence, Ivaylo. Can you confirm the version of the plugin that you're running? The latest is 1.8.1.2. Thanks!

  6. Scott Wells repo owner

    Okay, thanks for letting me know. I'll use the logs you've provided to see if I can take care of it. Sorry again for the issue!

  7. Scott Wells repo owner

    Ivaylo, would you mind emailing me the full log the next time this happens to you? The ones provided above never go through Illuminated Cloud so unfortunately they don't help me pin down the root cause. Thanks!

  8. Mike Wannamaker

    Hey Scott.
    Here is a set of logs.

    I opened IntelliJ, opened my project, then ran a set of tests with code coverage and got the infinite loop of processes, then shutdown down IntelliJ and the processes started shutting down.

    That should be the only thing in the logs as that is all I did.

    Using latest 1.8.2.3

    Hope this helps.

  9. Scott Wells repo owner

    Thanks, Mike! I'll take a look this afternoon/evening. Hopefully there's an obvious cause somewhere in there and I can take care of this thing once and for all. I'll keep you all posted here.

  10. Matt Smith

    @RoseSilverSoftware I am seeing the infinite loop issue when running unit tests with coverage. I am using version 2.0.2.3 of IlluminatedCloud. Here is a log snippet (I redacted my actual class names):

    2018-06-19 12:29:29,434 [ 125593]  ERROR - pplication.impl.LaterInvocator - Last Action: RunCoverage 
    2018-06-19 12:29:29,450 [ 125609]   WARN - ess.util.ProgressIndicatorBase - This progress indicator is indeterminate, this may lead to visual inconsistency. Please call setIndeterminate(false) before you start progress. 
    2018-06-19 12:29:30,968 [ 127127]   WARN - lij.coverage.ApexCoverageSuite - No uncovered line details found in coverage response for <Class1> when lines uncovered = 27. Adding all executable lines that were not reported as covered as uncovered. 
    2018-06-19 12:29:30,968 [ 127127]   WARN - lij.coverage.ApexCoverageSuite - No uncovered line details found in coverage response for <Class2> when lines uncovered = 9. Adding all executable lines that were not reported as covered as uncovered. 
    2018-06-19 12:29:30,968 [ 127127]   WARN - lij.coverage.ApexCoverageSuite - No uncovered line details found in coverage response for <Class3> when lines uncovered = 25. Adding all executable lines that were not reported as covered as uncovered. 
    2018-06-19 12:29:30,968 [ 127127]   WARN - lij.coverage.ApexCoverageSuite - No uncovered line details found in coverage response for <Class4> when lines uncovered = 144. Adding all executable lines that were not reported as covered as uncovered. 
    2018-06-19 12:29:30,984 [ 127143]   WARN - lij.coverage.ApexCoverageSuite - No uncovered line details found in coverage response for <Class5> when lines uncovered = 28. Adding all executable lines that were not reported as covered as uncovered. 
    2018-06-19 12:29:30,984 [ 127143]   WARN - lij.coverage.ApexCoverageSuite - No uncovered line details found in coverage response for <Class6> when lines uncovered = 37. Adding all executable lines that were not reported as covered as uncovered. 
    2018-06-19 12:29:30,984 [ 127143]   WARN - lij.coverage.ApexCoverageSuite - No uncovered line details found in coverage response for <Class7> when lines uncovered = 6. Adding all executable lines that were not reported as covered as uncovered. 
    2018-06-19 12:29:30,984 [ 127143]   WARN - lij.coverage.ApexCoverageSuite - No uncovered line details found in coverage response for <Class8> when lines uncovered = 1141. Adding all executable lines that were not reported as covered as uncovered. 
    2018-06-19 12:29:31,031 [ 127190]   WARN - lij.coverage.ApexCoverageSuite - No uncovered line details found in coverage response for <Class9> when lines uncovered = 15. Adding all executable lines that were not reported as covered as uncovered. 
    2018-06-19 12:29:31,046 [ 127205]   WARN - lij.coverage.ApexCoverageSuite - No uncovered line details found in coverage response for <Class10> when lines uncovered = 16. Adding all executable lines that were not reported as covered as uncovered. 
    2018-06-19 12:29:31,046 [ 127205]   WARN - lij.coverage.ApexCoverageSuite - No uncovered line details found in coverage response for <Class11> when lines uncovered = 46. Adding all executable lines that were not reported as covered as uncovered. 
    2018-06-19 12:29:31,046 [ 127205]   WARN - lij.coverage.ApexCoverageSuite - No uncovered line details found in coverage response for <Class12> when lines uncovered = 203. Adding all executable lines that were not reported as covered as uncovered. 
    2018-06-19 12:29:31,046 [ 127205]   WARN - lij.coverage.ApexCoverageSuite - No uncovered line details found in coverage response for <Class13> when lines uncovered = 276. Adding all executable lines that were not reported as covered as uncovered. 
    2018-06-19 12:29:31,046 [ 127205]   WARN - lij.coverage.ApexCoverageSuite - No uncovered line details found in coverage response for <Class14> when lines uncovered = 4. Adding all executable lines that were not reported as covered as uncovered. 
    2018-06-19 12:29:31,046 [ 127205]  ERROR - intellij.openapi.progress.Task - ContentElementType: FILE; file: FILE
        Boolean.TRUE.equals(getUserData(BUILDING_STUB)) = false
        getTreeElement() = Element(FILE)
        vFile instanceof VirtualFileWithId = true
        StubUpdatingIndex.canHaveStub(vFile) = false 
    java.lang.AssertionError: ContentElementType: FILE; file: FILE
        Boolean.TRUE.equals(getUserData(BUILDING_STUB)) = false
        getTreeElement() = Element(FILE)
        vFile instanceof VirtualFileWithId = true
        StubUpdatingIndex.canHaveStub(vFile) = false
        at com.intellij.psi.impl.source.PsiFileImpl.calcStubTree(PsiFileImpl.java:1047)
        at com.intellij.psi.stubs.StubProcessingHelperBase.checkType(StubProcessingHelperBase.java:83)
        at com.intellij.psi.stubs.StubProcessingHelperBase.processStubsInFile(StubProcessingHelperBase.java:63)
        at com.intellij.psi.stubs.StubIndexImpl$2.process(StubIndexImpl.java:319)
        at com.intellij.psi.stubs.StubIndexImpl$StubIdListContainerAction.perform(StubIndexImpl.java:640)
        at com.intellij.psi.stubs.StubIndexImpl$StubIdListContainerAction.perform(StubIndexImpl.java:628)
        at com.intellij.util.indexing.ValueContainer.forEach(ValueContainer.java:61)
        at com.intellij.psi.stubs.StubIndexImpl.doProcessStubs(StubIndexImpl.java:348)
        at com.intellij.psi.stubs.StubIndexImpl.processElements(StubIndexImpl.java:310)
        at com.intellij.psi.stubs.StubIndexImpl.processElements(StubIndexImpl.java:299)
        at com.intellij.psi.stubs.StubIndex.process(StubIndex.java:76)
        at com.intellij.psi.stubs.StubIndex.process(StubIndex.java:95)
        at com.intellij.psi.stubs.StubIndexImpl.get(StubIndexImpl.java:288)
        at com.intellij.psi.stubs.StubIndexImpl.get(StubIndexImpl.java:278)
        at com.intellij.psi.stubs.AbstractStubIndex.get(AbstractStubIndex.java:39)
        at com.illuminatedcloud.intellij.index.AbstractApexDeclarationStubIndex.get(AbstractApexDeclarationStubIndex.java:30)
        at com.illuminatedcloud.intellij.psi.util.ApexDeclarationUtil.fastFindTypeDeclaration(ApexDeclarationUtil.java:226)
        at com.illuminatedcloud.intellij.psi.util.ApexDeclarationUtil.findTypeDeclaration(ApexDeclarationUtil.java:196)
        at com.illuminatedcloud.intellij.psi.util.ApexDeclarationUtil.findTypeDeclaration(ApexDeclarationUtil.java:176)
        at com.illuminatedcloud.intellij.coverage.ApexCoverageEngine$5.compute(ApexCoverageEngine.java:613)
        at com.illuminatedcloud.intellij.coverage.ApexCoverageEngine$5.compute(ApexCoverageEngine.java:609)
        at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:917)
        at com.illuminatedcloud.intellij.coverage.ApexCoverageEngine.findClassOrTriggerDeclaration(ApexCoverageEngine.java:608)
        at com.illuminatedcloud.intellij.coverage.ApexCoverageSuite$2.run(ApexCoverageSuite.java:419)
        at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:750)
        at com.intellij.openapi.progress.impl.CoreProgressManager$5.run(CoreProgressManager.java:434)
        at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:157)
        at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:580)
        at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:525)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:85)
        at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:144)
        at com.intellij.openapi.application.impl.ApplicationImpl.lambda$null$10(ApplicationImpl.java:565)
        at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:305)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
    2018-06-19 12:29:31,046 [ 127205]  ERROR - intellij.openapi.progress.Task - IntelliJ IDEA 2018.1  Build #IU-181.4203.550 
    2018-06-19 12:29:31,046 [ 127205]  ERROR - intellij.openapi.progress.Task - JDK: 1.8.0_152-release 
    2018-06-19 12:29:31,046 [ 127205]  ERROR - intellij.openapi.progress.Task - VM: OpenJDK 64-Bit Server VM 
    2018-06-19 12:29:31,046 [ 127205]  ERROR - intellij.openapi.progress.Task - Vendor: JetBrains s.r.o 
    2018-06-19 12:29:31,046 [ 127205]  ERROR - intellij.openapi.progress.Task - OS: Windows 10 
    2018-06-19 12:29:31,046 [ 127205]  ERROR - intellij.openapi.progress.Task - Last Action: RunCoverage 
    2018-06-19 12:29:31,046 [ 127205]  ERROR - pplication.impl.LaterInvocator - com.intellij.lang.javascript.psi.impl.JSEmbeddedContentImpl cannot be cast to com.illuminatedcloud.intellij.psi.ApexTypeDeclaration 
    java.lang.ClassCastException: com.intellij.lang.javascript.psi.impl.JSEmbeddedContentImpl cannot be cast to com.illuminatedcloud.intellij.psi.ApexTypeDeclaration
        at com.illuminatedcloud.intellij.coverage.IlluminatedCloudConnectionTreeNode.getChildren(IlluminatedCloudConnectionTreeNode.java:71)
        at com.illuminatedcloud.intellij.coverage.ApexCoverageViewExtension$1.compute(ApexCoverageViewExtension.java:171)
        at com.illuminatedcloud.intellij.coverage.ApexCoverageViewExtension$1.compute(ApexCoverageViewExtension.java:163)
        at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:913)
        at com.illuminatedcloud.intellij.coverage.ApexCoverageViewExtension.getChildrenNodes(ApexCoverageViewExtension.java:162)
        at com.intellij.coverage.view.CoverageViewTreeStructure.getChildren(CoverageViewTreeStructure.java:49)
        at com.intellij.coverage.view.CoverageViewTreeStructure.getChildElements(CoverageViewTreeStructure.java:36)
        at com.intellij.ide.commander.AbstractListBuilder.<init>(AbstractListBuilder.java:82)
        at com.intellij.coverage.view.CoverageViewBuilder.<init>(CoverageViewBuilder.java:32)
        at com.intellij.coverage.view.CoverageView.<init>(CoverageView.java:91)
        at com.intellij.coverage.view.CoverageViewManager.createToolWindow(CoverageViewManager.java:75)
        at com.intellij.coverage.view.CoverageViewSuiteListener.afterSuiteChosen(CoverageViewSuiteListener.java:46)
        at com.intellij.coverage.CoverageDataManagerImpl.fireAfterSuiteChosen(CoverageDataManagerImpl.java:597)
        at com.intellij.coverage.CoverageDataManagerImpl.chooseSuitesBundle(CoverageDataManagerImpl.java:303)
        at com.illuminatedcloud.intellij.coverage.ApexCoverageSuite$1.run(ApexCoverageSuite.java:174)
        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)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
        at java.awt.EventQueue.access$500(EventQueue.java:98)
        at java.awt.EventQueue$3.run(EventQueue.java:715)
        at java.awt.EventQueue$3.run(EventQueue.java:709)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
        at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:837)
        at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:766)
        at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:434)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    2018-06-19 12:29:31,046 [ 127205]  ERROR - pplication.impl.LaterInvocator - IntelliJ IDEA 2018.1  Build #IU-181.4203.550 
    2018-06-19 12:29:31,046 [ 127205]  ERROR - pplication.impl.LaterInvocator - JDK: 1.8.0_152-release 
    2018-06-19 12:29:31,046 [ 127205]  ERROR - pplication.impl.LaterInvocator - VM: OpenJDK 64-Bit Server VM 
    2018-06-19 12:29:31,046 [ 127205]  ERROR - pplication.impl.LaterInvocator - Vendor: JetBrains s.r.o 
    2018-06-19 12:29:31,046 [ 127205]  ERROR - pplication.impl.LaterInvocator - OS: Windows 10 
    2018-06-19 12:29:31,046 [ 127205]  ERROR - pplication.impl.LaterInvocator - Last Action: RunCoverage
    
  11. Scott Wells repo owner

    Thanks, Matt. If this is what I've seen in the past, it's not an infinite loop as much as an event storm where a huge number of events get handled simultaneously. Are you seeing an ever-growing number of threads in the IDE status bar? If so, that's the same issue. I've finally reproduced this myself...once...but unfortunately didn't get very good diagnostic info on it to understand what particular combination of state causes it so that I can guard against it. Anyway, let's confirm that it is (or isn't) the same thing so I know whether I'm dealing with one issue or two. Thanks again!

  12. Matt Smith

    @RoseSilverSoftware No, the event storm is not also causing a runaway thread issue. Oddly enough, I have two projects that are sandboxes from the same prod org and the event storm only seems to occur for one of them, even if I run the exact same unit tests between the two orgs.

  13. Gery Loutre Account Deactivated

    hi there, I ve got the same issue and it does the loop each time. I am not doing something fancy, just pick a test class and run it with coverage...that's it, and I ve got the processes loop...

    I am preparing some logs that I ll send to you.

  14. Scott Wells repo owner

    Okay, I've restructured the way that coverage is loaded from the server into the plugin SDK's coverage framework. I believe this new approach will completely avoid all concurrency and re-entrancy. I've been testing it pretty thoroughly, but there's always a chance that something new crops up. However, I think this provides a much better foundation for the coupling between the Salesforce API for loading coverage and the plugin SDK's API for showing it, so I'd prefer to deal with any new issues in the context of this new approach. I'll include these changes in the next build.

  15. Scott Wells repo owner

    Delivered in 2.0.3.0 and 1.8.3.6. If you see ANY further issues with code coverage--either regressions to previously-working functionality or a recurrence of this issue--please let me know ASAP.

  16. Scott Wells repo owner

    Glad to hear, Géry! I hope this has truly put this set of issues to rest once and for all.

  17. Matt Smith

    @RoseSilverSoftware I just updated illuminated cloud to the latest version today and when I ran some unit tests with code coverage I saw this error in a pop up window:

    com.intellij.lang.javascript.psi.impl.JSEmbeddedContentImpl cannot be cast to com.illuminatedcloud.intellij.psi.ApexDeclaration

    That looks to be the same exception I was experiencing previously based on the stack trace I posted above. However, I am not actually seeing that error in the IntelliJ logs. This is what I see:

    2018-09-13 09:56:16,295 [3385983]  ERROR - aemon.impl.PassExecutorService - IntelliJ IDEA 2018.1  Build #IU-181.4203.550 
    2018-09-13 09:56:16,295 [3385983]  ERROR - aemon.impl.PassExecutorService - JDK: 1.8.0_152-release 
    2018-09-13 09:56:16,295 [3385983]  ERROR - aemon.impl.PassExecutorService - VM: OpenJDK 64-Bit Server VM 
    2018-09-13 09:56:16,295 [3385983]  ERROR - aemon.impl.PassExecutorService - Vendor: JetBrains s.r.o 
    2018-09-13 09:56:16,295 [3385983]  ERROR - aemon.impl.PassExecutorService - OS: Windows 10 
    2018-09-13 09:56:16,295 [3385983]  ERROR - aemon.impl.PassExecutorService - Last Action: SwitchCoverage 
    2018-09-13 09:56:16,295 [3385983]  ERROR - aemon.impl.PassExecutorService - ContentElementType: FILE; file: FILE
        Boolean.TRUE.equals(getUserData(BUILDING_STUB)) = false
        getTreeElement() = Element(FILE)
        vFile instanceof VirtualFileWithId = true
        StubUpdatingIndex.canHaveStub(vFile) = false 
    java.lang.AssertionError: ContentElementType: FILE; file: FILE
        Boolean.TRUE.equals(getUserData(BUILDING_STUB)) = false
        getTreeElement() = Element(FILE)
        vFile instanceof VirtualFileWithId = true
        StubUpdatingIndex.canHaveStub(vFile) = false
        at com.intellij.psi.impl.source.PsiFileImpl.calcStubTree(PsiFileImpl.java:1047)
        at com.intellij.psi.stubs.StubProcessingHelperBase.checkType(StubProcessingHelperBase.java:83)
        at com.intellij.psi.stubs.StubProcessingHelperBase.processStubsInFile(StubProcessingHelperBase.java:63)
        at com.intellij.psi.stubs.StubIndexImpl$2.process(StubIndexImpl.java:319)
        at com.intellij.psi.stubs.StubIndexImpl$StubIdListContainerAction.perform(StubIndexImpl.java:640)
        at com.intellij.psi.stubs.StubIndexImpl$StubIdListContainerAction.perform(StubIndexImpl.java:628)
        at com.intellij.util.indexing.ValueContainer.forEach(ValueContainer.java:61)
        at com.intellij.psi.stubs.StubIndexImpl.doProcessStubs(StubIndexImpl.java:348)
        at com.intellij.psi.stubs.StubIndexImpl.processElements(StubIndexImpl.java:310)
        at com.intellij.psi.stubs.StubIndexImpl.processElements(StubIndexImpl.java:299)
        at com.intellij.psi.stubs.StubIndex.process(StubIndex.java:76)
        at com.intellij.psi.stubs.StubIndex.process(StubIndex.java:95)
        at com.intellij.psi.stubs.StubIndexImpl.get(StubIndexImpl.java:288)
        at com.intellij.psi.stubs.StubIndexImpl.get(StubIndexImpl.java:278)
        at com.intellij.psi.stubs.AbstractStubIndex.get(AbstractStubIndex.java:39)
        at com.illuminatedcloud.intellij.index.AbstractApexDeclarationStubIndex.get(AbstractApexDeclarationStubIndex.java:30)
        at com.illuminatedcloud.intellij.psi.util.ApexDeclarationUtil.fastFindTypeDeclaration(ApexDeclarationUtil.java:226)
        at com.illuminatedcloud.intellij.psi.util.ApexDeclarationUtil.findTypeDeclaration(ApexDeclarationUtil.java:101)
        at com.illuminatedcloud.intellij.psi.util.ApexDeclarationUtil.findTypeDeclaration(ApexDeclarationUtil.java:77)
        at com.illuminatedcloud.intellij.psi.impl.ApexTypeMixin.lambda$getExpressionType$0(ApexTypeMixin.java:126)
        at com.intellij.psi.util.CachedValuesManager.lambda$getCachedValue$0(CachedValuesManager.java:140)
        at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:49)
        at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:222)
        at com.intellij.psi.impl.PsiCachedValue.getValueWithLock(PsiCachedValue.java:60)
        at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:38)
        at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:136)
        at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:126)
        at com.illuminatedcloud.intellij.psi.impl.ApexTypeMixin.getExpressionType(ApexTypeMixin.java:86)
        at com.illuminatedcloud.intellij.psi.impl.ApexFormalParameterMixin.doGetExpressionType(ApexFormalParameterMixin.java:77)
        at com.illuminatedcloud.intellij.psi.impl.ApexDeclarationMixin.lambda$getExpressionType$0(ApexDeclarationMixin.java:141)
        at com.intellij.psi.util.CachedValuesManager.lambda$getCachedValue$0(CachedValuesManager.java:140)
        at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:49)
        at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:222)
        at com.intellij.psi.impl.PsiCachedValue.getValueWithLock(PsiCachedValue.java:60)
        at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:38)
        at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:136)
        at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:126)
        at com.illuminatedcloud.intellij.psi.impl.ApexDeclarationMixin.getExpressionType(ApexDeclarationMixin.java:140)
        at com.illuminatedcloud.intellij.psi.impl.ApexInvokableDeclarationMixin.getSignature(ApexInvokableDeclarationMixin.java:58)
        at com.illuminatedcloud.intellij.psi.impl.ApexInvokableDeclarationMixin.lambda$getUniqueFullName$0(ApexInvokableDeclarationMixin.java:84)
        at com.intellij.psi.util.CachedValuesManager.lambda$getCachedValue$0(CachedValuesManager.java:140)
        at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:49)
        at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:222)
        at com.intellij.psi.impl.PsiCachedValue.getValueWithLock(PsiCachedValue.java:60)
        at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:38)
        at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:136)
        at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:126)
        at com.illuminatedcloud.intellij.psi.impl.ApexInvokableDeclarationMixin.getUniqueFullName(ApexInvokableDeclarationMixin.java:81)
        at com.illuminatedcloud.intellij.psi.impl.ApexTypeDeclarationMixin.getAccessibleBodyDeclarations(ApexTypeDeclarationMixin.java:208)
        at com.illuminatedcloud.intellij.psi.impl.ApexSimpleRefExpressionMixin.getMatchingBodyDeclarations(ApexSimpleRefExpressionMixin.java:935)
        at com.illuminatedcloud.intellij.psi.impl.ApexSimpleRefExpressionMixin.tryAsContinuationOfRefExpression(ApexSimpleRefExpressionMixin.java:743)
        at com.illuminatedcloud.intellij.psi.impl.ApexSimpleRefExpressionMixin.getReferencesNoCache(ApexSimpleRefExpressionMixin.java:181)
        at com.illuminatedcloud.intellij.psi.impl.ApexSimpleRefExpressionMixin.doGetReferences(ApexSimpleRefExpressionMixin.java:159)
        at com.illuminatedcloud.intellij.psi.impl.PsiReferenceCacheHolderExpression$1.doGetReferences(PsiReferenceCacheHolderExpression.java:57)
        at com.illuminatedcloud.intellij.psi.impl.PsiReferenceCache.compute(PsiReferenceCache.java:107)
        at com.intellij.psi.util.CachedValuesManager.lambda$getCachedValue$0(CachedValuesManager.java:140)
        at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:49)
        at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:222)
        at com.intellij.psi.impl.PsiCachedValue.getValueWithLock(PsiCachedValue.java:60)
        at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:38)
        at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:136)
        at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:126)
        at com.illuminatedcloud.intellij.psi.impl.PsiReferenceCache.getReferences(PsiReferenceCache.java:77)
        at com.illuminatedcloud.intellij.psi.impl.PsiReferenceCacheHolderExpression.getReferences(PsiReferenceCacheHolderExpression.java:47)
        at com.illuminatedcloud.intellij.editor.IlluminatedCloudSyntaxAnnotator.annotate(IlluminatedCloudSyntaxAnnotator.java:128)
        at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.runAnnotators(DefaultHighlightVisitor.java:139)
        at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:102)
        at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.runVisitors(GeneralHighlightingPass.java:371)
        at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$collectHighlights$5(GeneralHighlightingPass.java:303)
        at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:330)
        at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$analyzeByVisitors$6(GeneralHighlightingPass.java:333)
        at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:86)
        at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:333)
        at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectHighlights(GeneralHighlightingPass.java:300)
        at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:239)
        at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:83)
        at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
        at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$1(PassExecutorService.java:437)
        at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1134)
        at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:430)
        at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:580)
        at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:525)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:85)
        at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:429)
        at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:405)
        at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:143)
        at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:218)
        at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:403)
        at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:170)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
    2018-09-13 09:56:16,295 [3385983]  ERROR - aemon.impl.PassExecutorService - IntelliJ IDEA 2018.1  Build #IU-181.4203.550 
    2018-09-13 09:56:16,295 [3385983]  ERROR - aemon.impl.PassExecutorService - JDK: 1.8.0_152-release 
    2018-09-13 09:56:16,295 [3385983]  ERROR - aemon.impl.PassExecutorService - VM: OpenJDK 64-Bit Server VM 
    2018-09-13 09:56:16,295 [3385983]  ERROR - aemon.impl.PassExecutorService - Vendor: JetBrains s.r.o 
    2018-09-13 09:56:16,295 [3385983]  ERROR - aemon.impl.PassExecutorService - OS: Windows 10 
    2018-09-13 09:56:16,295 [3385983]  ERROR - aemon.impl.PassExecutorService - Last Action: SwitchCoverage 
    
  18. Scott Wells repo owner

    Matt, let me investigate this one a bit. I agree that it's related to the original stack trace, and it doesn't look like it's related to the original issue that folks were having in this bug where the IDE would spin off unbounded threads trying to show coverage. I may break this out into its own dedicated issue. I'll keep you posted based on what I find given the stack trace. Oh, and that other stack trace is unrelated. It's something I need to investigate, but it's occurring during syntax annotation in the editor.

  19. Log in to comment