Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexNotReadyException thrown in IDEA with installed UnitTestBot plugin #1236

Open
alisevych opened this issue Oct 26, 2022 · 3 comments
Open
Assignees
Labels
comp-ide Issue is related to IDE support ctg-bug Issue is a bug spec-flaky Reproducing scenario is not clear

Comments

@alisevych
Copy link
Member

alisevych commented Oct 26, 2022

Description

IndexNotReadyException thrown in IDEA with installed UnitTestBot plugin

To Reproduce

  1. Run the 'UTbotJava' project in IntelliJ Idea
  2. Use plugin to generate tests for samples
  3. Tests are generated
  4. Create a new Maven project

Expected behavior

New project should be created without exceptions from UnitTestBot.

Actual behavior

IndexNotReadyException thrown in IDEA from the installed UnitTestBot plugin.

Visual proofs (screenshots, logs, images)

image

com.intellij.openapi.project.IndexNotReadyException: Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation
	at com.intellij.openapi.project.IndexNotReadyException.create(IndexNotReadyException.java:67)
	at com.intellij.util.indexing.FileBasedIndexImpl.handleDumbMode(FileBasedIndexImpl.java:844)
	at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:792)
	at com.intellij.psi.stubs.StubIndexEx.getContainingIds(StubIndexEx.java:352)
	at com.intellij.psi.stubs.StubIndexEx.processElements(StubIndexEx.java:159)
	at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:99)
	at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:87)
	at com.intellij.psi.impl.java.stubs.index.JavaFullClassNameIndex.get(JavaFullClassNameIndex.java:34)
	at com.intellij.psi.impl.file.impl.JavaFileManagerImpl.doFindClasses(JavaFileManagerImpl.java:84)
	at com.intellij.psi.impl.file.impl.JavaFileManagerImpl.findClasses(JavaFileManagerImpl.java:72)
	at com.intellij.psi.impl.PsiElementFinderImpl.findClasses(PsiElementFinderImpl.java:53)
	at com.intellij.psi.impl.JavaPsiFacadeImpl.findClassesWithoutJvmFacade(JavaPsiFacadeImpl.java:159)
	at com.intellij.psi.impl.JavaPsiFacadeImpl.findClassesWithJvmFacade(JavaPsiFacadeImpl.java:130)
	at com.intellij.psi.impl.JavaPsiFacadeImpl.findClasses(JavaPsiFacadeImpl.java:122)
	at com.intellij.psi.impl.file.PsiPackageImpl.findAllClasses(PsiPackageImpl.java:202)
	at com.intellij.psi.impl.file.PsiPackageImpl.getCachedClassesByName(PsiPackageImpl.java:192)
	at com.intellij.psi.impl.file.PsiPackageImpl.findClassByShortName(PsiPackageImpl.java:269)
	at org.utbot.intellij.plugin.generator.CodeGenerationController$createTestClass$testClass$1$1$1.compute(CodeGenerationController.kt:587)
	at org.utbot.intellij.plugin.generator.CodeGenerationController$createTestClass$testClass$1$1$1.compute(CodeGenerationController.kt:582)
	at com.intellij.openapi.project.DumbService.lambda$runReadActionInSmartMode$0(DumbService.java:113)
	at com.intellij.openapi.project.DumbService.runReadActionInSmartMode(DumbService.java:144)
	at com.intellij.openapi.project.DumbService.runReadActionInSmartMode(DumbService.java:113)
	at org.utbot.intellij.plugin.generator.CodeGenerationController$createTestClass$testClass$1$1.compute(CodeGenerationController.kt:582)
	at org.utbot.intellij.plugin.generator.CodeGenerationController$createTestClass$testClass$1$1.compute(CodeGenerationController.kt:581)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:920)
	at org.utbot.intellij.plugin.generator.CodeGenerationController$createTestClass$testClass$1.call(CodeGenerationController.kt:581)
	at org.utbot.intellij.plugin.generator.CodeGenerationController$createTestClass$testClass$1.call(CodeGenerationController.kt:580)
	at com.intellij.openapi.application.impl.ApplicationImpl$2.call(ApplicationImpl.java:326)
	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.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
	at java.base/java.lang.Thread.run(Thread.java:829)

Environment

Windows 10 Pro
IntelliJ IDEA 2022.1.4 / 2022.2.3
UnitTestBot build from branch

Additional context

Reproducing on newly created projects

@alisevych
Copy link
Member Author

Reproduced during UnitTestBot plugin installation:

  1. Two projects were opened in IDEA 2022.2 with installed UnitTestBot plugin.
  2. File -> Settings -> Plugins -> Installed -> UnitTestBot plugin uninstall.
  3. Click OK, restart IDE.
  4. File -> Settings -> Plugins -> Install plugin from disk... new UnitTestBot version. Click OK.
IndexNotReadyException was thrown down to IDE immediately. com.intellij.openapi.project.IndexNotReadyException: Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation at com.intellij.openapi.project.IndexNotReadyException.create(IndexNotReadyException.java:67) at com.intellij.util.indexing.FileBasedIndexImpl.handleDumbMode(FileBasedIndexImpl.java:844) at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:792) at com.intellij.psi.stubs.StubIndexEx.getContainingIds(StubIndexEx.java:350) at com.intellij.psi.stubs.StubIndexEx.processElements(StubIndexEx.java:157) at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:99) at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:87) at com.intellij.psi.impl.java.stubs.index.JavaFullClassNameIndex.get(JavaFullClassNameIndex.java:34) at com.intellij.psi.impl.file.impl.JavaFileManagerImpl.doFindClasses(JavaFileManagerImpl.java:88) at com.intellij.psi.impl.file.impl.JavaFileManagerImpl.findClass(JavaFileManagerImpl.java:111) at com.intellij.psi.impl.PsiElementFinderImpl.findClass(PsiElementFinderImpl.java:40) at com.intellij.psi.impl.JavaPsiFacadeImpl.doFindClass(JavaPsiFacadeImpl.java:93) at com.intellij.psi.impl.JavaPsiFacadeImpl.findClass(JavaPsiFacadeImpl.java:71) at org.utbot.intellij.plugin.settings.MockAlwaysClassesTable$Companion.checkPsiClassByName(MockAlwaysClassesTable.kt:126) at org.utbot.intellij.plugin.settings.MockAlwaysClassesTable$Companion.access$checkPsiClassByName(MockAlwaysClassesTable.kt:73) at org.utbot.intellij.plugin.settings.MockAlwaysClassesTable$Companion$columnInfo$1$validationInfoProducer$1.apply(MockAlwaysClassesTable.kt:90) at org.utbot.intellij.plugin.settings.MockAlwaysClassesTable$Companion$columnInfo$1$validationInfoProducer$1.apply(MockAlwaysClassesTable.kt:80) at org.utbot.intellij.plugin.settings.MockAlwaysClassesTable$Companion$columnInfo$1$getEditor$1.get(MockAlwaysClassesTable.kt:101) at org.utbot.intellij.plugin.settings.MockAlwaysClassesTable$Companion$columnInfo$1$getEditor$1.get(MockAlwaysClassesTable.kt:98) at com.intellij.openapi.ui.ComponentValidator.revalidate(ComponentValidator.java:197) at java.base/java.util.Optional.ifPresent(Optional.java:178) at com.intellij.openapi.ui.ComponentValidator$2.textChanged(ComponentValidator.java:175) at com.intellij.ui.DocumentAdapter.insertUpdate(DocumentAdapter.java:15) at java.desktop/javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:226) at java.desktop/javax.swing.text.AbstractDocument.handleInsertString(AbstractDocument.java:780) at java.desktop/javax.swing.text.AbstractDocument.insertString(AbstractDocument.java:739) at java.desktop/javax.swing.text.PlainDocument.insertString(PlainDocument.java:131) at java.desktop/javax.swing.text.AbstractDocument.replace(AbstractDocument.java:698) at java.desktop/javax.swing.text.JTextComponent.setText(JTextComponent.java:1729) at com.intellij.ui.components.JBTextField.setText(JBTextField.java:87) at java.desktop/javax.swing.DefaultCellEditor$1.setValue(DefaultCellEditor.java:91) at java.desktop/javax.swing.DefaultCellEditor.getTableCellEditorComponent(DefaultCellEditor.java:269) at java.desktop/javax.swing.JTable.prepareEditor(JTable.java:5867) at com.intellij.ui.table.JBTable.editCellAt(JBTable.java:650) at java.desktop/javax.swing.JTable.editCellAt(JTable.java:3523) at com.intellij.execution.util.ListTableWithButtons.lambda$addNewElement$2(ListTableWithButtons.java:107) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:779) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:730) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:724) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:749) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:918) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:766) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:450) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:791) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:449) at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105) at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:624) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:447) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:881) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:493) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

@alisevych alisevych added the comp-ide Issue is related to IDE support label Feb 6, 2023
@alisevych
Copy link
Member Author

Reproduced again, when running test generation in a new IntelliJ project with newly installed JDK 17:

  1. Plugin built from main installed in IDEA 2022.2.4
  2. New IntelliJ project was created with JDK 17
  3. Sample CastExamples was copy-pasted into the Sources root
  4. Test generation was started with TestNG (not yet installed)
  5. File -> Project structure was opened

Actual results:

  1. Error popup was shown: "CastExamplesTest cannot be created."
  2. IndexNotReadyException was thrown down to IDE immediately.
stacktrace is the same com.intellij.openapi.project.IndexNotReadyException: Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation at com.intellij.openapi.project.IndexNotReadyException.create(IndexNotReadyException.java:67) at com.intellij.util.indexing.FileBasedIndexImpl.handleDumbMode(FileBasedIndexImpl.java:844) at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:792) at com.intellij.psi.stubs.StubIndexEx.getContainingIds(StubIndexEx.java:350) at com.intellij.psi.stubs.StubIndexEx.processElements(StubIndexEx.java:157) at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:99) at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:87) at com.intellij.psi.impl.java.stubs.index.JavaFullClassNameIndex.get(JavaFullClassNameIndex.java:34) at com.intellij.psi.impl.file.impl.JavaFileManagerImpl.doFindClasses(JavaFileManagerImpl.java:88) at com.intellij.psi.impl.file.impl.JavaFileManagerImpl.findClass(JavaFileManagerImpl.java:111) at com.intellij.psi.impl.PsiElementFinderImpl.findClass(PsiElementFinderImpl.java:40) at com.intellij.psi.impl.JavaPsiFacadeImpl.doFindClass(JavaPsiFacadeImpl.java:93) at com.intellij.psi.impl.JavaPsiFacadeImpl.findClass(JavaPsiFacadeImpl.java:71) at org.utbot.intellij.plugin.settings.MockAlwaysClassesTable$Companion.checkPsiClassByName(MockAlwaysClassesTable.kt:126) at org.utbot.intellij.plugin.settings.MockAlwaysClassesTable$Companion.access$checkPsiClassByName(MockAlwaysClassesTable.kt:73) at org.utbot.intellij.plugin.settings.MockAlwaysClassesTable$Companion$columnInfo$1$validationInfoProducer$1.apply(MockAlwaysClassesTable.kt:90) at org.utbot.intellij.plugin.settings.MockAlwaysClassesTable$Companion$columnInfo$1$validationInfoProducer$1.apply(MockAlwaysClassesTable.kt:80) at org.utbot.intellij.plugin.settings.MockAlwaysClassesTable$Companion$columnInfo$1$getEditor$1.get(MockAlwaysClassesTable.kt:101) at org.utbot.intellij.plugin.settings.MockAlwaysClassesTable$Companion$columnInfo$1$getEditor$1.get(MockAlwaysClassesTable.kt:98) at com.intellij.openapi.ui.ComponentValidator.revalidate(ComponentValidator.java:197) at java.base/java.util.Optional.ifPresent(Optional.java:178) at com.intellij.openapi.ui.ComponentValidator$2.textChanged(ComponentValidator.java:175) at com.intellij.ui.DocumentAdapter.insertUpdate(DocumentAdapter.java:15) at java.desktop/javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:226) at java.desktop/javax.swing.text.AbstractDocument.handleInsertString(AbstractDocument.java:780) at java.desktop/javax.swing.text.AbstractDocument.insertString(AbstractDocument.java:739) at java.desktop/javax.swing.text.PlainDocument.insertString(PlainDocument.java:131) at java.desktop/javax.swing.text.AbstractDocument.replace(AbstractDocument.java:698) at java.desktop/javax.swing.text.JTextComponent.setText(JTextComponent.java:1729) at com.intellij.ui.components.JBTextField.setText(JBTextField.java:87) at java.desktop/javax.swing.DefaultCellEditor$1.setValue(DefaultCellEditor.java:91) at java.desktop/javax.swing.DefaultCellEditor.getTableCellEditorComponent(DefaultCellEditor.java:269) at java.desktop/javax.swing.JTable.prepareEditor(JTable.java:5867) at com.intellij.ui.table.JBTable.editCellAt(JBTable.java:650) at java.desktop/javax.swing.JTable.editCellAt(JTable.java:3523) at com.intellij.execution.util.ListTableWithButtons.lambda$addNewElement$2(ListTableWithButtons.java:107) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:779) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:730) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:724) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:749) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:918) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:766) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:450) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:791) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:449) at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105) at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:624) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:447) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:881) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:493) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

@alisevych alisevych added the spec-flaky Reproducing scenario is not clear label Feb 28, 2023
@alisevych
Copy link
Member Author

Reproducing again

New project with another JDK was created when test generation was about to finish.

  • Error message: "ArrayOfArraysTest class cannot be saved"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-ide Issue is related to IDE support ctg-bug Issue is a bug spec-flaky Reproducing scenario is not clear
Projects
Status: Todo
Development

No branches or pull requests

2 participants