Test Explorer / #runTests (AL Language) hangs indefinitely on a compilation error instead of reporting the build failure
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 881
- Forks
- 285
- Avg merge
- 3d 36m
- Merged PRs (30d)
- 1
Description
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:
- #7750 (
Publish-NAVApphangs on compile errors) ΓÇö that is server-side PowerShell / BcContainerHelper, not the VS Code test runner. - #8181 (
al.publishNoDebugnot returning a result) ΓÇö publish path, no compilation error involved. - #8197 (test run doesn't end in a pre-BC28 container) ΓÇö triggered by "server does not support running tests", a different cause; only the hang symptom overlaps.
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
#runTeststool. - 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
Internal work item: AB#641378
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the VS Code Test Explorer run path and the programmatic #runTests entry point, then reproduce the failure in the multi-root AL workspace described using the launch configuration and al.package diagnostics. Trace how the compilation result is passed to test results and cancellation, and compare it with the Problems panel output. Done means a compilation error ends the run promptly, appears in test results, and returns a failure to #runTests without requiring a window reload.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, vscode
- Domain
- devtools, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100