Atwix / phpstorm-plugin-feedback

6 stars 0 forks source link

[Bug] java.lang.AssertionError: Reentrant indexing #23

Closed carlos-reynosa closed 1 year ago

carlos-reynosa commented 1 year ago

Describe the bug (*)

Please, describe as much as possible about of what the bug is. It will help to solve this issue faster.

StackTrace from IDE

java.lang.AssertionError: Reentrant indexing
    at com.intellij.util.indexing.FileBasedIndexImpl.markFileIndexed(FileBasedIndexImpl.java:1783)
    at com.intellij.util.indexing.FileBasedIndexImpl.createSingleIndexValueApplier(FileBasedIndexImpl.java:1675)
    at com.intellij.util.indexing.FileBasedIndexImpl.updateSingleIndex(FileBasedIndexImpl.java:1636)
    at com.intellij.util.indexing.FileBasedIndexImpl.scheduleFileForIndexing(FileBasedIndexImpl.java:1950)
    at com.intellij.util.indexing.events.ChangedFilesCollector$4.process(ChangedFilesCollector.java:232)
    at com.intellij.util.indexing.events.ChangedFilesCollector$5.lambda$process$0(ChangedFilesCollector.java:271)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeNonCancelableSection$3(CoreProgressManager.java:222)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:628)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$computeInNonCancelableSection$4(CoreProgressManager.java:230)
    at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:95)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeInNonCancelableSection(CoreProgressManager.java:230)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:221)
    at com.intellij.util.indexing.events.ChangedFilesCollector$5.lambda$process$1(ChangedFilesCollector.java:270)
    at com.intellij.util.ConcurrencyUtil.withLock(ConcurrencyUtil.java:248)
    at com.intellij.util.indexing.events.ChangedFilesCollector$5.process(ChangedFilesCollector.java:268)
    at com.intellij.util.indexing.events.VfsEventsMerger.processChanges(VfsEventsMerger.java:99)
    at com.intellij.util.indexing.events.ChangedFilesCollector.processFilesInReadAction(ChangedFilesCollector.java:265)
    at com.intellij.util.indexing.events.ChangedFilesCollector.processFilesToUpdateInReadAction(ChangedFilesCollector.java:224)
    at com.intellij.util.indexing.events.ChangedFilesCollector.ensureUpToDate(ChangedFilesCollector.java:190)
    at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:836)
    at com.intellij.psi.stubs.StubIndexEx.getContainingIds(StubIndexEx.java:365)
    at com.intellij.psi.stubs.StubIndexEx.processElements(StubIndexEx.java:166)
    at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:102)
    at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:90)
    at com.jetbrains.php.PhpIndexImpl.getElements(PhpIndexImpl.java:739)
    at com.jetbrains.php.PhpIndexImpl.getByName(PhpIndexImpl.java:1176)
    at com.jetbrains.php.PhpIndexImpl.getByFQN(PhpIndexImpl.java:1153)
    at com.jetbrains.php.PhpIndexImpl.getByFqnCacheAware(PhpIndexImpl.java:1234)
    at com.jetbrains.php.PhpIndexImpl.getClassesByFQNInternal(PhpIndexImpl.java:1229)
    at com.jetbrains.php.PhpIndexImpl.getClassesByFQN(PhpIndexImpl.java:1218)
    at com.jetbrains.php.PhpClassHierarchyUtils.getSuperClasses(PhpClassHierarchyUtils.java:575)
    at com.jetbrains.php.lang.psi.elements.impl.PhpClassImpl.getSuperClasses(PhpClassImpl.java:497)
    at com.jetbrains.php.lang.psi.elements.impl.PhpClassImpl.getSuperClass(PhpClassImpl.java:491)
    at com.atwix.magento.framework.test.MagentoTestSourceVerifier.getAllSupperClasses(MagentoTestSourceVerifier.java:143)
    at com.atwix.magento.framework.test.MagentoTestSourceVerifier.isTestClass(MagentoTestSourceVerifier.java:128)
    at com.atwix.magento.framework.test.MagentoTestSourceVerifier.isTestSource(MagentoTestSourceVerifier.java:124)
    at com.atwix.magento.framework.test.MagentoTestSourceVerifier.isTestSource(MagentoTestSourceVerifier.java:111)
    at com.atwix.magento.project.configurator.MagentoTestSourceFilterService.isTestSource(MagentoTestSourceFilterService.java:33)
    at com.intellij.openapi.roots.TestSourcesFilter.isTestSources(TestSourcesFilter.java:31)
    at com.pestphp.pest.PhpTestFolderInputFilter.acceptInput(PhpTestFolderInputFilter.kt:16)
    at com.pestphp.pest.features.datasets.DatasetIndex$getInputFilter$1.acceptInput(DatasetIndex.kt:67)
    at com.intellij.util.indexing.FileBasedIndexEx$1.acceptInput(FileBasedIndexEx.java:818)
    at com.intellij.util.indexing.FileBasedIndexEx.acceptsInput(FileBasedIndexEx.java:805)
    at com.intellij.util.indexing.FileBasedIndexImpl.acceptsInput(FileBasedIndexImpl.java:2058)
    at com.intellij.util.indexing.FileBasedIndexImpl.lambda$scheduleFileForIndexing$31(FileBasedIndexImpl.java:1972)
    at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.freezeFileTypeTemporarilyWithProvidedValueIn(FileTypeManagerImpl.java:675)
    at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.freezeFileTypeTemporarilyIn(FileTypeManagerImpl.java:658)
    at com.intellij.util.indexing.FileBasedIndexImpl.scheduleFileForIndexing(FileBasedIndexImpl.java:1965)
    at com.intellij.util.indexing.events.ChangedFilesCollector$4.process(ChangedFilesCollector.java:232)
    at com.intellij.util.indexing.events.ChangedFilesCollector$5.lambda$process$0(ChangedFilesCollector.java:271)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeNonCancelableSection$3(CoreProgressManager.java:222)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$co

To Reproduce (*)

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Screenshots

If applicable, add screenshots to help explain your problem.

System information:

bohdan-harniuk commented 1 year ago

Hello, @carlos-reynosa!

The issue occurred due to a conflict with the Pest plugin, which can be found on GitHub: The official Pest Plugin for PhpStorm.

The root of the problem is that the Pest plugin runs the method TestSourcesFilter.isTestSources(file, it) (this method calls all the test sources verifications in PHPStorm) in a custom test source verification service within the custom index: DatasetIndex. This approach is problematic because it can cause other plugins, including ours, that access or may access any index inside test source verification to encounter an exception with the message "java.lang.AssertionError: Reentrant indexing."

We have fixed this issue by disabling custom test source verification if Pest plugin is installed and enabled. This fix will be available in the upcoming release: 2023.4.0.

Regards,

bohdan-harniuk commented 1 year ago

Hi @carlos-reynosa,

New release 2023.4 is publicly available. I am closing this issue as solved.

Regards,