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

JetBrains: Crash occurred while clicking on "Generate Unit Test". #1436

Closed
jay-fibi opened this issue May 1, 2024 · 2 comments · Fixed by #1478
Closed

JetBrains: Crash occurred while clicking on "Generate Unit Test". #1436

jay-fibi opened this issue May 1, 2024 · 2 comments · Fixed by #1478
Assignees
Labels

Comments

@jay-fibi
Copy link
Collaborator

jay-fibi commented May 1, 2024

Cody Version

v5.5.8

IDE Information

IntelliJ IDEA 2023.3.4 (Community Edition)
Build #IC-233.14475.28, built on February 13, 2024
Runtime version: 17.0.10+1-b1087.17 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 12
Registry:
ide.experimental.ui=true
Non-Bundled Plugins:
PythonCore (233.14475.9)
com.soywiz.korge.korge-intellij-plugin (4.0.4)
com.sourcegraph.jetbrains (5.5.8)
Kotlin: 233.14475.28-IJ

Describe the bug

Platform: Windows

Steps to reproduce:

  1. Have Cody plugin installed in your JB IntelliJ IDEA editor
  2. Login to Cody with PRO user
  3. Open any source code file and right click to open context menu
  4. Choose "Cody > Generate Unit Test"

Observed behavior:

Crash occurred with following stacktrace,
Stacktrace:

java.util.concurrent.CompletionException: java.nio.file.InvalidPathException: Illegal char <:> at index 46: c:/Users/Jay Gohil/IdeaProjects/jaysVSDemo/\\c:\Users\Jay Gohil\IdeaProjects\jaysVSDemo\BubbleSortTest.java
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:332)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:347)
	at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:708)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162)
	at com.sourcegraph.cody.agent.CodyAgentClient.lambda$acceptOnEventThread$0(CodyAgentClient.java:118)
	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.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:843)
	at com.intellij.openapi.application.impl.ApplicationImpl$4.run(ApplicationImpl.java:463)
	at com.intellij.openapi.application.impl.RwLockHolder.runWithEnabledImplicitRead(RwLockHolder.kt:75)
	at com.intellij.openapi.application.impl.RwLockHolder.runWithImplicitRead(RwLockHolder.kt:67)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWithImplicitRead(ApplicationImpl.java:1436)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:82)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:124)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:44)
	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:695)
	at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$12(IdeEventQueue.kt:589)
	at com.intellij.openapi.application.impl.RwLockHolder.runWithoutImplicitRead(RwLockHolder.kt:44)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:589)
	at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:72)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:355)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:354)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:793)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:354)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:349)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1014)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1014)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:349)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:848)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:391)
	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)
Caused by: java.nio.file.InvalidPathException: Illegal char <:> at index 46: c:/Users/Jay Gohil/IdeaProjects/jaysVSDemo/\\c:\Users\Jay Gohil\IdeaProjects\jaysVSDemo\BubbleSortTest.java
	at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:177)
	at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
	at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
	at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
	at java.base/sun.nio.fs.WindowsUriSupport.fromUri(WindowsUriSupport.java:166)
	at java.base/sun.nio.fs.WindowsFileSystemProvider.getPath(WindowsFileSystemProvider.java:98)
	at java.base/java.nio.file.Path.of(Path.java:203)
	at java.base/java.nio.file.Paths.get(Paths.java:98)
	at com.sourcegraph.cody.edit.sessions.FixupSession.createAndSwitchFileIfNeeded(FixupSession.kt:298)
	at com.sourcegraph.cody.edit.sessions.FixupSession.performWorkspaceEdit(FixupSession.kt:268)
	at com.sourcegraph.cody.agent.CodyAgentService$1.invoke$lambda$4(CodyAgentService.kt:60)
	at com.sourcegraph.cody.agent.CodyAgentClient.lambda$acceptOnEventThread$1(CodyAgentClient.java:130)
	at com.sourcegraph.cody.agent.CodyAgentClient.lambda$acceptOnEventThread$0(CodyAgentClient.java:113)
	... 40 more

Expected behavior

Crash should not occur and Cody should generate unit test.

Additional context

Video link:

https://drive.google.com/file/d/1vtE6y_g448Cd7k6YQj2CvTwK5hCgFBY0/view?usp=drive_link

@jay-fibi jay-fibi added bug Something isn't working fibilabs-qa fibilabs-qa-p0 labels May 1, 2024
@mkondratek mkondratek self-assigned this May 7, 2024
@mkondratek
Copy link
Contributor

One note: the give stacktrace is slightly different from the one visible in the video - the second one mentions com.sourcegraph.utils.CodyEditorUtil#showDocument.

Anyway, it looks like a window issue.

@kalanchan
Copy link
Contributor

blocks generate test working on windows

mkondratek added a commit that referenced this issue May 15, 2024
Fixes #1436.

Btw it fixes an issue with an error when closing a file that's content
is being generated.


## Test plan
1. `Generate Unit Test` on both Windows and macOs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants