Skip to content

Clicking "debug" on a specific test runs ALL the tests in the case. #1773

Closed as not planned

Description

@SomervilleTom

When I mouse over a specific test and then click on the "debug" icon, all the tests in the containing case are also run.

Image

The above screenshot shows the "PersistentObjectTests" TestCase. When I mouse over the debug icon in the circled test ("testGateRegistryCleanup"), a "Debug Test" flyover shows. When I click that, all 7 tests run (in debug mode) instead of just the selected test.

When I want to run all the tests, I click the "debug" icon of "PersistentObjectTests". That behaves as expected.

When I click the debug icon of a specific test, I expect just that selected test to run.

I'm using JUnit 4.13.2 (according to "pom.xml". I don't know how to tell which JDK I'm running. This is all in a RockyLinux system.

Here is the content of the "Test Result" view in VSC after clicking the single test:

%TESTC  7 v2
%TSTTREE1,org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest,true,7,false,-1,org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest,,
%TSTTREE2,testGateRegistryCleanup(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest),false,1,false,-1,testGateRegistryCleanup(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest),,
%TSTTREE3,testGateRegistryReset(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest),false,1,false,-1,testGateRegistryReset(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest),,
%TSTTREE4,testRestartAlreadyStarted(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest),false,1,false,-1,testRestartAlreadyStarted(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest),,
%TSTTREE5,testGateIDCreate(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest),false,1,false,-1,testGateIDCreate(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest),,
%TSTTREE6,testRestart(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest),false,1,false,-1,testRestart(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest),,
%TSTTREE7,testLastIDReset(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest),false,1,false,-1,testLastIDReset(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest),,
%TSTTREE8,testStartUp(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest),false,1,false,-1,testStartUp(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest),,
%TESTS  2,testGateRegistryCleanup(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest)

%TESTE  2,testGateRegistryCleanup(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest)

%TESTS  3,testGateRegistryReset(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest)

%TESTE  3,testGateRegistryReset(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest)
%TESTS  4,testRestartAlreadyStarted(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest)

%TESTE  4,testRestartAlreadyStarted(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest)

%TESTS  5,testGateIDCreate(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest)
%TESTE  5,testGateIDCreate(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest)

%TESTS  6,testRestart(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest)

%TESTE  6,testRestart(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest)

%TESTS  7,testLastIDReset(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest)
%TESTE  7,testLastIDReset(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest)
%TESTS  8,testStartUp(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest)

%TESTE  8,testStartUp(org.zeetix.gate.daemon.persistent_objects.PersistentObjectTest)

%RUNTIME1733

This behavior is certainly unexpected, if not an outright bug. It make test-driven development tedious.

Activity

  1. github-actions commented on Nov 13, 2025

    @github-actions

    Hi SomervilleTom, I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.

    This behavior is a known limitation in the Java Test Runner: the testController logic currently defaults to running the entire class when you invoke Debug, even if you target a single method. See:

    Workarounds

    • In the Test Explorer view, right-click the desired test method and choose Debug Test Method rather than using the inline icon.
    • Watch the linked issue for a permanent fix in an upcoming extension release.

    The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!

  2. SomervilleTom commented on Nov 13, 2025

    @SomervilleTom
    Author

    Using the right-button "Debug test method" in any of the views results in the same unwanted behavior -- all tests run.

    In order to debug a single test without running all the others, I need to edit the test file ("FoobarTest.java") and comment out each test except the desired test. This is a TERRIBLE practice, forced by this bug.

    Perhaps real human will someday pay attention to this issue. The catch-22 is that this issue will stay "Not Planned" until some actual human investigates it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions