JetBrains / intellij-ui-test-robot

The library allows you to write and execute UI tests among IntelliJ IDEA. You can test your Plugin.
https://jetbrains-platform.slack.com/archives/C026SVA9MMM
Apache License 2.0
107 stars 31 forks source link

JTreeFixture.expandAll() throws IdeaSideException: Wrapped java.util.concurrent.TimeoutException #459

Open martinszuc opened 2 months ago

martinszuc commented 2 months ago

OS: Same error on mac-os, linux and windows IJ: C-2024.1

When updated com.intellij.remoterobot:remote-fixtures:0.11.22 to 0.11.23 we get this exception every time expand is called on a JTreeFixture representing the Maven tree inside Maven Tool Window. Same error appears on Gradle tree as well.

The tree itself is expanded in the UI but the test case ends because of this exception. Happens with old and new UI. Did the usage of expand on JTreeFixture change somehow or am I missing something?

INFO: Search 'JTreeFixture' by 'by type javax.swing.JTree'
Jul 23, 2024 7:05:23 PM com.intellij.remoterobot.stepsProcessing.StepLogger doBeforeStep
INFO: Expand all
Jul 23, 2024 7:05:28 PM com.intellij.remoterobot.stepsProcessing.StepLogger doOnFail
WARNING:     Failed on step: Expand all (StepWorker.kt_step)
Jul 23, 2024 7:05:28 PM com.intellij.remoterobot.stepsProcessing.StepLogger doBeforeStep

com.intellij.remoterobot.client.IdeaSideException: Wrapped java.util.concurrent.TimeoutException
    at com.intellij.remoterobot.client.IdeRobotClient.throwIdeaSideError(IdeRobotClient.kt:141)
    at com.intellij.remoterobot.client.IdeRobotClient.processExecuteResponse(IdeRobotClient.kt:108)
    at com.intellij.remoterobot.client.IdeRobotClient.execute(IdeRobotClient.kt:63)
    at com.intellij.remoterobot.JavaScriptApi$DefaultImpls.runJs(JavaScriptApi.kt:57)
    at com.intellij.remoterobot.RemoteRobot.runJs(RemoteRobot.kt:32)
    at com.intellij.remoterobot.fixtures.Fixture.runJs(Fixture.kt:92)
    at com.intellij.remoterobot.fixtures.JTreeFixture$expandAll$1.invoke(JTreeFixture.kt:152)
    at com.intellij.remoterobot.fixtures.JTreeFixture$expandAll$1.invoke(JTreeFixture.kt:151)
    at com.intellij.remoterobot.stepsProcessing.StepWorkerKt.step(StepWorker.kt:23)
    at com.intellij.remoterobot.fixtures.JTreeFixture.expandAll(JTreeFixture.kt:151)
    at com.redhat.devtools.intellij.commonuitest.fixtures.test.mainidewindow.toolwindowspane.buildtoolpane.MavenBuildToolPaneTest.collapseAllTest(MavenBuildToolPaneTest.java:67)

Below are stacktraces of error within the intellij that appear after the expand is called:

java.lang.Throwable: UI was frozen for 5014ms, details saved to /home/mszuc/projects/intellij-common-ui-test-library/src/test-project/build/idea-sandbox/system/log/threadDumps-freeze-20240723-190533-IC-241.14494.240-Throwable._init_-5sec
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:376)
    at com.intellij.diagnostic.PerformanceWatcherImplKt.postProcessReportFolder(PerformanceWatcherImpl.kt:450)
    at com.intellij.diagnostic.PerformanceWatcherImplKt.access$postProcessReportFolder(PerformanceWatcherImpl.kt:1)
    at com.intellij.diagnostic.PerformanceWatcherImpl$FreezeCheckerTask$stopFreezeReporting$1.invokeSuspend(PerformanceWatcherImpl.kt:375)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
java.lang.Throwable: Slow operations are prohibited on EDT. See SlowOperations.assertSlowOperationsAreAllowed javadoc.
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:376)
    at com.intellij.util.SlowOperations.assertSlowOperationsAreAllowed(SlowOperations.java:106)
    at com.intellij.openapi.vfs.newvfs.persistent.FSRecordsImpl.update(FSRecordsImpl.java:728)
    at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.findChildInfo(PersistentFSImpl.java:673)
    at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.findInPersistence(VirtualDirectoryImpl.java:157)
    at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.doFindChild(VirtualDirectoryImpl.java:139)
    at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.findChild(VirtualDirectoryImpl.java:85)
    at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.refreshAndFindChild(VirtualDirectoryImpl.java:351)
    at com.intellij.openapi.vfs.newvfs.VfsImplUtil.refreshAndFindFileByPath(VfsImplUtil.java:118)
    at com.intellij.openapi.vfs.impl.local.LocalFileSystemBase.refreshAndFindFileByPath(LocalFileSystemBase.java:125)
    at com.intellij.openapi.vfs.impl.VirtualFileManagerImpl.findByNioPath(VirtualFileManagerImpl.java:389)
    at com.intellij.openapi.vfs.impl.VirtualFileManagerImpl.refreshAndFindFileByNioPath(VirtualFileManagerImpl.java:381)
    at com.intellij.openapi.vfs.VirtualFileUtil.refreshAndFindVirtualFileOrDirectory(VirtualFileUtil.kt:167)
    at com.intellij.openapi.vfs.VirtualFileUtil.refreshAndFindVirtualFile(VirtualFileUtil.kt:171)
    at com.intellij.ide.projectWizard.generators.AssetsNewProjectWizardStep$setupProject$1$1.invoke(AssetsNewProjectWizardStep.kt:89)
    at com.intellij.ide.projectWizard.generators.AssetsNewProjectWizardStep$setupProject$1$1.invoke(AssetsNewProjectWizardStep.kt:88)
    at com.intellij.ide.wizard.UIWizardUtil.whenProjectCreated$lambda$2$lambda$1(UIWizardUtil.kt:170)
    at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
    at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:209)
    at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:22)
    at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:191)
    at com.intellij.openapi.application.impl.RwLockHolder.runIntendedWriteActionOnCurrentThread(RwLockHolder.kt:204)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:830)
    at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:419)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithEnabledImplicitRead(RwLockHolder.kt:138)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithImplicitRead(RwLockHolder.kt:129)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWithImplicitRead(ApplicationImpl.java:1152)
    at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:81)
    at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:123)
    at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:43)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:792)
    at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
    at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
    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:761)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:698)
    at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$12(IdeEventQueue.kt:593)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithoutImplicitRead(RwLockHolder.kt:105)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:593)
    at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:77)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:362)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:361)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:843)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:361)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:356)
    at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1021)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
    at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1021)
    at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:356)
    at com.intellij.openapi.application.impl.RwLockHolder.runIntendedWriteActionOnCurrentThread(RwLockHolder.kt:209)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:830)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:398)
    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)
martinszuc commented 2 months ago

@nizienko Do you have any thoughts or advice that could help us please?

Munsio commented 2 weeks ago

I've run into the same error with 2023.3, even tried old/new UI but there is no difference. It is working on 2022.3 though.

It is probably the following change: https://github.com/JetBrains/intellij-ui-test-robot/compare/v0.11.22...v0.11.23#diff-e59b64e811ceb9d0060397247e04dbdd8b24ee6e6c0cb9f0ad2a412b21650cb1