altool runtests hangs after TestRunnerHub Initialize fails with application authentication
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- powershell
- Área
- authentication, cli, testing
Línea de trabajo
Start with the altool.dll runtests entry point and the TestRunnerHub Initialize and cleanup flow described in the report. Compare application-token and delegated authentication, then verify that an initialization failure is reported with a nonzero exit instead of leaving the process running; a minimal public AL test extension is still needed to confirm the reproduction.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
1. Describe the bug
When running altool runtests against a Business Central Online sandbox using an application access token (client credentials), the tool connects to TestRunnerHub but does not complete or return a useful error.
An isolated diagnostic call using the installed Microsoft AL libraries exposed a server exception from Initialize. Disposing the failed runner also did not complete within a five-second diagnostic deadline.
Using delegated user authentication with the same environment, company, tool version and installed extensions, all ten test methods pass.
We have not confirmed whether application authentication is supported for this endpoint. Regardless, the CLI should report the initialization failure and exit instead of hanging.
2. To Reproduce
- Use a Business Central Online sandbox with a published AL test extension.
- Configure an enabled Entra application in BC with:
- Application API permissions:
API.ReadWrite.AllandAutomation.ReadWrite.All, with tenant consent. - BC permission sets:
D365 AUTOMATIONandEXTEN. MGT. - ADMIN, without a company restriction.
- Application API permissions:
- Obtain a client-credentials access token for the target tenant and the Business Central resource.
- Supply it to the CLI through the
BC_ACCESS_TOKENenvironment variable. - Run:
dotnet "<AL-extension-directory>/bin/altool.dll" runtests `
--testgroups "<path-to-test-groups.json>" `
--tenant "<tenant-id>" `
--environmentname "<sandbox-name>" `
--environmenttype Sandbox `
--company "<company-name>"
- Observe that the process connects but does not finish. In our pipeline, we cancelled it after more than five minutes.
- Repeat using normal delegated AL authentication against the same target. The tests complete successfully.
To isolate the failure, we also used the installed Microsoft AL libraries to connect and invoke only:
Initialize("<company-name>", "", CoverageMode.None)
This reproduced the exception before any test method was invoked.
The original tests belong to a private customer extension. We have not yet reproduced this with a separate minimal public AL test extension. The initialization-only diagnostic isolates the failure from execution of the test methods.
3. Expected behavior
If application authentication is supported, initialization and test execution should complete with the required permissions.
If it is unsupported, or initialization otherwise fails, the CLI should report a clear error and exit with a nonzero exit code. Cleanup should not prevent the error from being reported.
4. Actual behavior
With application authentication:
- Extension publication through the Automation API succeeds.
- Developer metadata retrieval and the TestRunnerHub connection succeed.
- The isolated Initialize call returns:
Microsoft.AspNetCore.SignalR.HubException:
An unexpected error occurred invoking 'Initialize' on the server.
- Disposing the failed runner exceeds a five-second diagnostic deadline.
- The normal CLI remains running without producing a completed test result.
With delegated authentication:
- Initialization succeeds.
- All ten named test methods pass.
We verified the application's BC permission assignments through the Automation API. D365 AUTOMATION includes execute permission on Codeunit ID 0 (all codeunits). However, we have not established equivalent effective permissions or entitlements between the application identity and the delegated administrator.
The Admin Center telemetry query covering the failure returned HTTP 200 with no entries. Application Insights is not configured, so the underlying server exception remains unknown.
An external process timeout now prevents our pipeline from hanging indefinitely, but it does not resolve the initialization failure.
5. Versions:
- AL Language: 18.0.2732683
- Visual Studio Code: Not involved in the failing reproduction;
altool.dllwas invoked directly usingdotnet. - Business Central: Online sandbox, application version 28.5.54151.54677
- .NET runtime: 10.0.12
- List of Visual Studio Code extensions that you have installed: The reproduction runs outside the VS Code extension host. A separate IDE reproduction with all other extensions disabled has not been performed.
- Operating System:
- Windows — build 26200
- 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
Isolation performed: reproduced the Initialize failure without invoking any test methods. A minimal public AL test project is not yet available.
- Lenguaje dominante
- PowerShell
- Estrellas
- 889
- Forks
- 285
- Merge medio
- 4 h 7 min
- PR fusionados (30 d)
- 1
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/AL
-
accepted al-tools bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
-
[Extensibility Request] Allow extending available font sizes in RichContent editor (sizes 5-7)Abiertosuggestion
Dificultad 5/5 Más de una semana Aptitud para principiantes 45/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
-
Dificultad 4/5 1-2 días Aptitud para principiantes 45/100
Todos los issues de microsoft/AL
Issues similares
-
建议给 pgsql 的证书 SAN 增加 vip 地址Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
[Bug]: 2026.10.10-beta.5 drops the #179205 shared-OAuth deleted-peer fix (regression of #178908)Abiertoclawsweeper:needs-maintainer-review clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:auth-provider issue-rating: 🦞 diamond lobster P1
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
openclaw/openclaw#190705 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
esphome/home-assistant-addon#274 ·
-
backend Low Priority subtask
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Bearkat-Professionals/Software-Engineering-Project#87 ·
Los mantenedores suelen responder en 1 día