mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-08-08 18:31:36 +01:00
Add new action skills for AL testing and documentation
- Introduced `al-test-writer` to generate AL test codeunits for production objects based on TDD principles. - Added `al-userguide-test-writer` to create test codeunits from user guide steps, mapping actions and assertions. - Implemented `bc-extension-test-guide` to generate a comprehensive TEST_GUIDE.md for Business Central extensions, covering various categories. - Created `bc-webclient-runner` to automate UI testing of the Business Central web client, capturing screenshots and asserting UI states. - Developed `page-scripting-e2e` to produce a recording plan for Page Scripting, ensuring a structured approach to browser-level testing.
This commit is contained in:
parent
822cae1b27
commit
07140e2223
76 changed files with 4353 additions and 6 deletions
|
|
@ -0,0 +1,37 @@
|
|||
// Anti-pattern: the inbound handler BLOCKS the request thread, Sleep-polling an external
|
||||
// service until it completes. The caller's connection is held open for the whole wait,
|
||||
// and concurrent requests pile up on pinned threads.
|
||||
|
||||
codeunit 50123 "Inbound Intake Bad"
|
||||
{
|
||||
// Called on the request path. It does not return until the remote work is done,
|
||||
// so its runtime is entirely dictated by a system BC does not control.
|
||||
procedure Accept(Payload: Text): Text
|
||||
var
|
||||
Client: HttpClient;
|
||||
Response: HttpResponseMessage;
|
||||
JobId: Text;
|
||||
Done: Boolean;
|
||||
begin
|
||||
JobId := StartRemoteJob(Client, Payload);
|
||||
|
||||
// BAD: Sleep inside a loop on the request thread. This single request now holds
|
||||
// its thread and session slot for the full duration of the remote job.
|
||||
repeat
|
||||
// When the downstream is SLOW: this blocks for seconds or minutes. The caller's
|
||||
// HTTP connection times out long before the loop ends, and the work it kicked
|
||||
// off is orphaned with no staged row recording it.
|
||||
Sleep(2000);
|
||||
|
||||
// When the downstream is DOWN: this Get blocks until its own timeout, every
|
||||
// iteration, making a slow failure even slower.
|
||||
Client.Get(StrSubstNo('https://svc.contoso.com/jobs/%1', JobId), Response);
|
||||
Done := IsComplete(Response);
|
||||
until Done;
|
||||
|
||||
// Under load: each in-flight request pins a thread here. A handful of slow calls
|
||||
// exhaust the request slots and BC starts rejecting healthy callers too. One slow
|
||||
// dependency becomes a site-wide outage.
|
||||
exit('completed'); // by now the original caller has almost certainly timed out
|
||||
end;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue