Skip to content

Test Explorer / #runTests (AL Language) hangs indefinitely on a compilation error instead of reporting the build failure #8284

Description

@FBakkensen

1. Describe the bug

When tests are run through the VS Code Test Explorer (or programmatically via the GitHub Copilot #runTests tool), the AL Language extension compiles the test app before running. If the workspace contains a compilation error, the test run never finishes and the compile error is never surfaced to the test results. The run hangs indefinitely; the Cancel button in Test Explorer has no effect, and the only way to recover is to reload the VS Code window.

The compilation error itself is detected correctly — it appears in the Problems panel / via al.package. It is simply never reported back as the reason the test run cannot start, and programmatic callers (Copilot #runTests) never receive a result, which causes the calling chat session to hang.

This is distinct from:

2. To Reproduce

Steps to reproduce the behavior:

  1. Open a multi-root AL workspace with a main app and a test app (test app depends on the main app), targeting a BC 28.x dev server/container via the launch configuration.
  2. Confirm the tests are discovered and listed in Test Explorer.
  3. Introduce a compilation error in the main app, e.g.:
codeunit 50100 "Repro Codeunit"
{
    procedure Foo()
    begin
        ThisSymbolDoesNotExist();   // undeclared method -> compile error
    end;
}
  1. Run any test (single test or Run All) from Test Explorer, or invoke the Copilot #runTests tool.
  2. Observe: the run starts, compilation fails, but the run never completes, no compile error is shown in the test results, Cancel does nothing, and the run only ends after reloading the window.

3. Expected behavior

The test run should fail fast and surface the compilation error (the same AL diagnostics shown in the Problems panel) as the reason the run could not start. The run — and any programmatic #runTests caller — should return promptly with a clear failure.

4. Actual behavior

The test run hangs indefinitely. No compile error is reported in the test results, Cancel has no effect, and the run ends only on a VS Code window reload. The #runTests invocation never returns, hanging the calling Copilot chat session.

5. Versions:

  • AL Language: 18.0.2498801
  • Visual Studio Code: 1.126.0
  • Business Central: 28.2 (OnPrem, w1 Docker container)
  • List of Visual Studio Code extensions that you have installed: AL Language, waldo's CRS AL Language Extension, NAB AL Tools, BC Telemetry Buddy (to be re-confirmed with only the AL Language extension enabled)
  • Operating System:
    • Windows
    • Linux
    • MacOS

Final Checklist

  • Search the issue repository to ensure you are reporting a new issue
  • Reproduce the issue after disabling all extensions except the AL Language extension
  • Simplify your code around the issue to better isolate the problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions