Repository navigation
Running a test (or debugging) constantly churns and never starts #1038
Description
I am pretty much at wits end with VSCode and debugging Java code in a average sized project and spending more time cleaning workspaces, toggling settings, and just trying to get things to run than coding. We moved to VSCode with the hopes of standardizing on it across multiple languages and because it is lighter than IntelliJ.
When things work. they work well enough. It is when I go to "run a test" inside the editor (mostly this is the frustration) that I am having problems and it seems to be related to the workspace. I should also note, when things work I have no problem debugging a test, attaching to the instance, etc.
Sometimes, it can take 10 or so minutes before it even gets into the debugger or runner. Most of the time it just churns showing "Java Build Status" and never seems to end. It seems I need to "clean the workspace" (which itself can take quite a while) frequently to even start to work.
What does seem to work (any of the steps below):
- Turning off "autobuild" when using the workspace works but requires me to rebuild each time outside the IDE any modules that potentially changed
- Open only a single project (and not a workspace) - things seem to work much better.
- Running Maven in the CLI directly or in the CI server (the POM is not even overly complex).
I am hoping it is something in my configuration or setup because as I mentioned VSCode works well enough for everything else.
Environment
Note: everything below is using the latest version
- Operating System: Windows 10 using WSL2
- JDK version: JDK15 (project is set to use JDK11 compliance)
- Visual Studio Code version: 1.58.3
- Java extension version: 0.18.12 (extension pack)
- Java Debugger extension version: 0.35.0
- Java Test Runner extension version: 0.30.1
Additionally dependencies that may be relevant are:
- Quarkus
- MapStruct (very few changes made here and I do I just rebuild outside VSCode first)
- Lombok
Other configuration/setup that may be relevant is:
- Using "workspaces"
- Very minimal amount of extensions (pretty much only Java)
Steps To Reproduce
Using a workspace...
- Run any test case - the first time may/may not work after a while - shows "Compiling Workspace" and "Java Build Status"
If it happens to work, then for a while afterwards it works fine.
Current Result
Keeps churning and never returns. In addition, it seems like over time until I clean the workspaces (numerous times) this also happens:
- Intellisense fails to work
- CodeLens disappear
Expected Result
Should be able to run a test case consistently after making changes in the IDE.
Additional Informations
Workspace settings
"settings": {
"java.configuration.updateBuildConfiguration": "automatic",
"java.format.settings.profile": "logicdrop",
"java.dependency.packagePresentation": "hierarchical",
"java.dependency.syncWithFolderExplorer": false,
"java.test.report.position": "sideView",
"java.configuration.maven.userSettings": "",
"java.eclipse.downloadSources": true,
"java.home": "/opt/java",
"java.signatureHelp.enabled": true,
"rest-client.enableCustomVariableReferencesCodeLens": false,
"taskExplorer.enableSideBar": true,
"java.maxConcurrentBuilds": 4,
"java.references.includeDecompiledSources": false,
"java.autobuild.enabled": false,
"java.debug.logLevel": "verbose",
"java.debug.settings.showLogicalStructure": false,
"java.debug.settings.stepping.skipSynthetics": true,
"java.debug.settings.vmArgs": "-Xmx1G",
"java.completion.overwrite": false
}
Maven compiler configuration (all also declared in dependencies as "provided" scope.
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<parameters>true</parameters>
<source>11</source>
<target>11</target>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-mapstruct-binding</artifactId>
<version>0.1.0</version>
</path>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${mapstruct.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
Logs?
Activity
testforstephen commentedon Aug 9, 2021
Do you mean running a test is stuck at "compiling workspace"? If so, you can turn off the setting
java.debug.settings.forceBuildBeforeLaunch.kjq commentedon Aug 16, 2021
I am not sure if this was it but turning off autobuild but leaving on debug building seems to work. This also may be related to another issue (redhat-developer/vscode-java#2064) indirectly. Once I worked through autobuild and the stopping workspace cleanup everything seemed to work fine.