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:
- 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.
- Confirm the tests are discovered and listed in Test Explorer.
- Introduce a compilation error in the main app, e.g.:
codeunit 50100 "Repro Codeunit"
{
procedure Foo()
begin
ThisSymbolDoesNotExist(); // undeclared method -> compile error
end;
}
- Run any test (single test or Run All) from Test Explorer, or invoke the Copilot
#runTests tool.
- 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:
Final Checklist
1. Describe the bug
When tests are run through the VS Code Test Explorer (or programmatically via the GitHub Copilot
#runTeststool), 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:
Publish-NAVApphangs forever on compilation errors #7750 (Publish-NAVApphangs on compile errors) — that is server-side PowerShell / BcContainerHelper, not the VS Code test runner.al.publishNoDebugnot returning a result) — publish path, no compilation error involved.2. To Reproduce
Steps to reproduce the behavior:
#runTeststool.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
#runTestscaller — 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
#runTestsinvocation never returns, hanging the calling Copilot chat session.5. Versions:
Final Checklist