Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Running unit test in UI causes, "Click to run tests" to disappear on newer versions of gradle #1505

@sbs20

Description

@sbs20

Environment:

  • VS Code Version: 1.104.1
  • Extension Version: 0.30.2
  • JDK Type & Version: Adoptium 21.0.5.11
  • OS Type & Version: Windows 11 24H2

Step to Reproduce:

  • Medium sized, multi-module java project with Gradle 8.14.3. 19 sub modules.
  • Run a JUnit5 unit test in the UI by clicking "Click to run tests" icon (next to the unit test in the UI)

Expected Behavior:

  • After test completion, I expect to be able to press "Click to run tests" again immediately

Actual Behavior:

  • "Click to run tests" icon (next to the unit test in the UI) disappears - as in, this one:

    Image
  • "Build Server for Gradle" output console just shows and scrolls this sort of thing for about 5-10 minutes while it seemingly rebuilds

    [INFO - 12:17:47] Sending response 'workspace/buildTargets'. Processing request took 0 ms.
    [INFO - 12:17:48] Sending response 'workspace/buildTargets'. Processing request took 0 ms.
    [INFO - 12:17:48] Sending response 'buildTarget/outputPaths'. Processing request took 0 ms.
    [INFO - 12:17:48] Sending response 'buildTarget/sources'. Processing request took 0 ms.
    [INFO - 12:17:48] Sending response 'buildTarget/resources'. Processing request took 0 ms.
    [INFO - 12:17:48] Sending response 'buildTarget/outputPaths'. Processing request took 0 ms.
    [INFO - 12:17:48] Sending response 'buildTarget/sources'. Processing request took 0 ms.
    [INFO - 12:17:48] Sending response 'buildTarget/resources'. Processing request took 0 ms.
    [INFO - 12:17:48] Sending response 'buildTarget/dependencyModules'. Processing request took 0 ms.
    [INFO - 12:17:48] Sending response 'buildTarget/dependencyModules'. Processing request took 0 ms.
    [INFO - 12:17:48] Sending response 'buildTarget/javacOptions'. Processing request took 2 ms.
    [INFO - 12:17:48] Sending response 'workspace/buildTargets'. Processing request took 0 ms.
    [INFO - 12:17:48] Sending response 'workspace/buildTargets'. Processing request took 0 ms.
    [INFO - 12:17:48] Sending response 'buildTarget/outputPaths'. Processing request took 0 ms.
    [INFO - 12:17:48] Sending response 'buildTarget/sources'. Processing request took 0 ms.
    [INFO - 12:17:48] Sending response 'buildTarget/resources'. Processing request took 0 ms.
    [INFO - 12:17:48] Sending response 'buildTarget/outputPaths'. Processing request took 0 ms.
    [INFO - 12:17:48] Sending response 'buildTarget/sources'. Processing request took 0 ms.
    
  • Eventually (10 mins later?) "Click to run tests" icon reappears.

Related Issues:

None found

Further diagnostic info

  • Happens on Java Adoptium 17.0.6.10 & 21.0.5.11
  • Also happens with Gradle 9.0.0
  • Most importantly it does not happen if I downgrade Gradle (in gradle/wrapper/gradle-wrapper.properyes) to 8.11.1. This is my current workaround.
  • I have not dug further to work out where, between 8.11.1 and 8.14.3 it all goes wrong

Total speculation

  • My guess is that this is a combination of a moderately large project in conjunction with using build-server-for-gradle and a newish version of Gradle.
  • I'd further speculate that Gradle itself has changed and creates (or detects?) some output when a unit test has run which maybe invalidates it cache or something.

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