UnitTestBot / UTBotJava

Automated unit test generation and precise code analysis for Java
Apache License 2.0
136 stars 43 forks source link

JS. TimeoutException from `JsDialogProcessorKt.installMissingRequirement` #1882

Closed alisevych closed 1 year ago

alisevych commented 1 year ago

Description

TimeoutException from JsDialogProcessorKt.installMissingRequirement when a missing requirement is selected to install. This occurs in debug IU (run with runIde).

To Reproduce

  1. Run the 'utbot' project in IntelliJ Idea 2022.2.4 Ultimate
  2. Set ideType=IU in gradle.properties
  3. Run Gradle task runIde
  4. Create a new JavaScript project
  5. In File -> Settings -> Tools -> UnitTestBot set Experimental languages support
  6. Copy-paste a JS-file into it, f.e. bitOperators.js sample on
  7. Press Alt+Shift+U
  8. Popup with prompt to install mocha is shown. Click Ok

Expected behavior

Requirements are supposed to be installed. Is not - a clear notification should be shown that mocha was not installed.

Actual behavior

org.utbot.framework.plugin.api.TimeoutException is thrown down to IDEA from JsDialogProcessorKt.installMissingRequirement

Visual proofs (screenshots, logs, images)

org.utbot.framework.plugin.api.TimeoutException: 
    at utils.JsCmdExec.runCommand(JsCmdExec.kt:27)
    at settings.PackageData.installPackage(JsPackagesSettings.kt:39)
    at org.utbot.intellij.plugin.language.js.JsDialogProcessorKt.installMissingRequirement(JsDialogProcessor.kt:302)
    at org.utbot.intellij.plugin.language.js.JsDialogProcessorKt.checkAndInstallRequirement(JsDialogProcessor.kt:276)
    at org.utbot.intellij.plugin.language.js.JsDialogProcessor$createDialogAndGenerateTests$1$run$$inlined$invokeLater$1.run(ApplicationUtils.kt:94)
    at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:209)
    at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:21)
    at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:191)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:881)
    at com.intellij.openapi.application.impl.ApplicationImpl$3.run(ApplicationImpl.java:513)
    at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:75)
    at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:118)
    at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:42)
    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)

image

Environment

Windows 10 Pro IntelliJ IDEA 2022.2.2 (Ultimate Edition)

rudolf101 commented 1 year ago

@alisevych TimeoutException from JsDialogProcessorKt.installMissingRequirement occurs every time after a message about the lack of a mocha in debug mode, or is it a recurring problem? Are there any breakpoints pointing to the JsCmdExec.kt file?

alisevych commented 1 year ago

It happens every time when a missing requirement installation is accepted. When mocha installation is cancelled and nyc installation is accepted with Ok - the same exception is thrown.

runIde is executed in run mode, not debug, no breakpoints are present.