You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nickzhumsMartin Lippert (@martinlippert) I've installed the pre-release version of Spring Boot Tools. I can confirm that I had no issues with autocompletion at the time of the usage. However, the test span was rather short, ~10 minutes. But normally it was enough to just change a symbol once to encounter the bug. So, a green light from me.
However, after installing the said extension I also did launch the test suite run with the other extension that is called Test Runner for Java (vscjava.vscode-java-test). And the difference was, that the test suite that used to be green before Spring Boot Tools installation now became partially red. "SpringBootTest"-based tests went red, with the following error: javax.management.InstanceAlreadyExistsException
I've removed the extension, and the suite went green again. I guess, this issue is well described here: #1420
Sheng Chen (@jdneo) I can confirm that with "boot-java.live-information.automatic-connection.on": false
Extension "Test runner for Java" starts working properly, and "already exists" error does not appear anymore.
I remember this issue is fixed with spring-projects/spring-tools@ec8a5a8. Looks like it appears again recently. Is there anything changed at the spring boot extension side?
Sheng Chen (@jdneo) It'd be great to fully reproduce this use case. Share the project with the testFileName file and contents... Or provide instructions how this launch.json has been generated as it seems like i have assemble missing pieces of the config manually (i.e. classpath test class names file etc).
Sounds like you were able to reproduce the issue with spring-petclinic project... Please provide instructions on how to reproduce this issue starting from the "vanilla" petclinic project downloaded from spring io.
There is nothing changed around launching and connecting to apps as far as I remember... I also see that canConnect(...) method checks if main class is not one of the test runner classes (i.e. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner) here. The config above has exactly the class name that is being watched for thus I'm puzzled why it is an issue...
I have tried launching the tests from the tab (don't think there is launch.json generated for this) as well as just running all tests within a test class - all seems to run fine. My attempt to launch the config above ended with unable to connect via port... but I'll keep trying for now until i have better steps to reproduce the issue.
Alex Boyko (@BoykoAlex) I'm not able to reproduce it via the spring-petclinic. It's just working perfectly.
The launch config I shared just in case if there is any clue to troubleshoot the problem.
Recently there are several reports about the boot-java.live-information.automatic-connection.on will impact the test execution. Besides this issue, another one can be found here: #1530. But unfortunately, none of the users shared a sample project 😢.
This issue has been closed automatically because it needs more information and has not had recent activity. Please reach out if you have or find the answers we need so that we can investigate further.
I'm experiencing the same issue, where tests are failing with a javax.management.InstanceAlreadyExistsException when the tests are run through Test Explorer with STS's live information enabled. Here is a repository containing a minimal example:
The tests in that repository succeed when boot-java.live-information.automatic-connection.on is set to false, but they fail when it is true. The key to reproducing the error seems to be defining multiple test classes with different parameters in the @SpringBootTest annotation:
@SpringBootTest
class DemoApplicationTests {/* ... */}
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
class MoreDemoApplicationTests {/* ... */}
Tests run fine... do you mind tweaking that specific Maven project into something that has test failures? It is important to include .vscode folder under your project as well as it might be that your creating a launch config that results in the test failures... I launched tests by opening the test source and clicking on the test run icon in the gutters.
Activity
jdneo commentedon Mar 14, 2023
Nikita Pavlovski (@nikitades) instead of uninstalling the extension. Have you tried to turn off
boot-java.live-information.automatic-connection.on?nikitades commentedon Mar 14, 2023
Sheng Chen (@jdneo) I can confirm that with
"boot-java.live-information.automatic-connection.on": falseExtension "Test runner for Java" starts working properly, and "already exists" error does not appear anymore.
All good.
Thanks! ❤️
jdneo commentedon Mar 15, 2023
Nikita Pavlovski (@nikitades) Thanks for the update.
Hi Alex Boyko (@BoykoAlex)
I remember this issue is fixed with spring-projects/spring-tools@ec8a5a8. Looks like it appears again recently. Is there anything changed at the spring boot extension side?
martinlippert commentedon Mar 15, 2023
Sheng Chen (@jdneo) Can you share the launch config of the tests that you are running?
jdneo commentedon Mar 15, 2023
The launch config looks like below if I run the tests from the spring petclinic project.
Nikita Pavlovski (@nikitades) could you share a sample project for this issue?
BoykoAlex commentedon Mar 15, 2023
Sheng Chen (@jdneo) It'd be great to fully reproduce this use case. Share the project with the testFileName file and contents... Or provide instructions how this
launch.jsonhas been generated as it seems like i have assemble missing pieces of the config manually (i.e. classpath test class names file etc).Sounds like you were able to reproduce the issue with spring-petclinic project... Please provide instructions on how to reproduce this issue starting from the "vanilla" petclinic project downloaded from spring io.
There is nothing changed around launching and connecting to apps as far as I remember... I also see that
canConnect(...)method checks if main class is not one of the test runner classes (i.e.org.eclipse.jdt.internal.junit.runner.RemoteTestRunner) here. The config above has exactly the class name that is being watched for thus I'm puzzled why it is an issue...I have tried launching the tests from the tab (don't think there is
launch.jsongenerated for this) as well as just running all tests within a test class - all seems to run fine. My attempt to launch the config above ended with unable to connect via port... but I'll keep trying for now until i have better steps to reproduce the issue.jdneo commentedon Mar 16, 2023
Alex Boyko (@BoykoAlex) I'm not able to reproduce it via the spring-petclinic. It's just working perfectly.
The launch config I shared just in case if there is any clue to troubleshoot the problem.
Recently there are several reports about the
boot-java.live-information.automatic-connection.onwill impact the test execution. Besides this issue, another one can be found here: #1530. But unfortunately, none of the users shared a sample project 😢.BoykoAlex commentedon Mar 16, 2023
I see, thanks for the clarification... Seems like I'd need a sample project to reproduce this as well...
github-actions commentedon Apr 4, 2023
This issue has been closed automatically because it needs more information and has not had recent activity. Please reach out if you have or find the answers we need so that we can investigate further.
bradlord commentedon May 15, 2023
I'm experiencing the same issue, where tests are failing with a
javax.management.InstanceAlreadyExistsExceptionwhen the tests are run through Test Explorer with STS's live information enabled. Here is a repository containing a minimal example:https://github.com/bradlord/spring-boot-sts-test-failure
The tests in that repository succeed when
boot-java.live-information.automatic-connection.onis set to false, but they fail when it is true. The key to reproducing the error seems to be defining multiple test classes with different parameters in the@SpringBootTestannotation:Thank you.
BoykoAlex commentedon May 15, 2023
Bradley Lord (@bradlord) I couldn't get the gradle project working in vscode, therefore, I have convrted your project into Maven project:
sts-test-failure.zip
Tests run fine... do you mind tweaking that specific Maven project into something that has test failures? It is important to include
.vscodefolder under your project as well as it might be that your creating a launch config that results in the test failures... I launched tests by opening the test source and clicking on the test run icon in the gutters.BoykoAlex commentedon May 15, 2023
Bradley Lord (@bradlord) actually, NVM, got one of the tests to fail if run from the explorer
BoykoAlex commentedon May 15, 2023
Bradley Lord (@bradlord) fixed with spring-projects/spring-tools@a906005 Feel free to try the pre-release version of Spring Boot Tools a few days later. Thanks very much for reporting this and providing a test project!
jdneo commentedon May 16, 2023
Thank you for the help Alex Boyko (@BoykoAlex)!