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

AlreadyDisposedException when the project is closed before test generation ends #835

Closed
alisevych opened this issue Sep 1, 2022 · 1 comment
Assignees
Labels
ctg-bug Issue is a bug

Comments

@alisevych
Copy link
Member

Description

AlreadyDisposedException is thrown in IDEA when the project is closed before test generation ends.

To Reproduce

  1. Open IntelliJ IDEA with UTBot installed
  2. Open/clone UTBotJava project
  3. Use plugin to generate tests (for ArrayQuickSort f.i.)
  4. Create a new project
  5. Select to Open Project in This Window
    image

Expected behavior

No exceptions should be thrown in IDE

Actual behavior

Initiated test generation continues. AlreadyDisposedException is thrown in IDEA.

Visual proofs (screenshots, logs, images)

com.intellij.serviceContainer.AlreadyDisposedException: Cannot create com.intellij.psi.PsiManager because container is already disposed (container=Project(name=utbot, containerState=DISPOSE_COMPLETED, componentStore=C:\Users\lWX1182794\UTBotJava) (disposed))
	at com.intellij.serviceContainer.ContainerUtilKt.throwAlreadyDisposedError(containerUtil.kt:34)
	at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:632)
	at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:584)
	at com.intellij.openapi.client.ClientAwareComponentManager.getFromSelfOrCurrentSession(ClientAwareComponentManager.kt:37)
	at com.intellij.openapi.client.ClientAwareComponentManager.getService(ClientAwareComponentManager.kt:22)
	at com.intellij.psi.PsiManager.getInstance(PsiManager.java:25)
	at org.jetbrains.kotlin.idea.core.util.PhysicalFileSystemUtilsKt.toPsiDirectory(PhysicalFileSystemUtils.kt:23)
	at org.utbot.intellij.plugin.generator.CodeGenerationController.generateTests(CodeGenerationController.kt:92)
	at org.utbot.intellij.plugin.generator.UtTestsDialogProcessor$createTests$2$1$run$$inlined$invokeLater$default$2.run(actions.kt:63)
	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:215)
	at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:22)
	at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:197)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:873)
	at com.intellij.openapi.application.impl.ApplicationImpl$3.run(ApplicationImpl.java:511)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:69)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:112)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:42)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:898)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:746)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:439)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:803)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:438)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
	at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:604)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:436)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:873)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:484)
	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)

Environment

Windows 10 Pro
IntelliJ IDEA 2022.1.4

@alisevych alisevych added the ctg-bug Issue is a bug label Sep 1, 2022
@korifey korifey moved this to Todo in UTBot Java Sep 1, 2022
@alisevych alisevych self-assigned this Feb 28, 2023
@alisevych
Copy link
Member Author

Not reproducing any more. The test generation is stopped and new project is opened without any exception.

@alisevych alisevych closed this as not planned Won't fix, can't repro, duplicate, stale May 17, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in UTBot Java May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ctg-bug Issue is a bug
Projects
Archived in project
Development

No branches or pull requests

3 participants