Skip to content

When running Java unit tests via Test Runner for Java in WSL2, the UI stays stuck at: Resolving launch configuration... #1854

Closed

Description

@inkpark

Bug Description

When running Java unit tests via Test Runner for Java, the UI stays stuck at:
Resolving launch configuration...

Root Cause

VS Code Test Runner for Java 0.44.0 creates a local socket server before launching tests. It uses get-port to pre-select a port, then closes the probe socket and rebinds to the same port on
127.0.0.1. In WSL/Windows port environments, this "pre-select then rebind" pattern causes massive EADDRINUSE failures.

Evidence from VS Code extension log:
Error: listen EADDRINUSE: address already in use 127.0.0.1:46129
Error: listen EADDRINUSE: address already in use 127.0.0.1:46423
Error: listen EADDRINUSE: address already in use 127.0.0.1:46333
Error: listen EADDRINUSE: address already in use 127.0.0.1:46049
Error: listen EADDRINUSE: address already in use 127.0.0.1:45865

Reproduction

The problematic pattern in the extension:

const port = await getPort();  // Step 1: reserve a port
server.listen(port, "127.0.0.1", callback);  // Step 2: rebind to same port
In the affected environment, ~96 out of 100 such attempts fail.

Suggested Fix

Replace the two-step port selection with direct port allocation:
server.listen(0, "127.0.0.1", callback);  // OS auto-assigns a free port
This approach achieves 0 failures in the same environment.

Environment

- OS: Windows + WSL
- VS Code Test Runner for Java: 0.44.0
- Multiple JDKs installed (Java 8, 21, 25)

Activity

  1. github-actions commented on Apr 11, 2026

    @github-actions

    Hi inkpark, 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.

    Suggested Workarounds

    • Upgrade to the latest “Test Runner for Java” extension (>= 0.45.x) once available. A similar “stuck at Resolving launch configuration” bug on WSL2 was reported and fixed in #1481.

    • As a temporary local patch, edit the port‐binding logic in your installed extension:

      1. Open <USER>/.vscode/extensions/vscjava.vscode-java-test-0.44.0/client/out/src/server.js.
      2. Replace:
        const port = await getPort();
        server.listen(port, "127.0.0.1", callback);
        with:
        server.listen(0, "127.0.0.1", callback);
      3. Reload VS Code and rerun your tests.

    Duplicate Issues

    • No exact duplicates found for version 0.44.0.

    Other references with high confidence

    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. inkpark commented on Apr 12, 2026

    @inkpark
    ContributorAuthor

    btw I'd like to work on this issue.

  3. added a commit that references this issue on Apr 12, 2026
    ad6228d
  4. added a commit that references this issue on Apr 20, 2026
    de66eae
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