Re-enable BCPT Setup Card tests: fix NoOfSqlCallsAreLogged SQL assertion (Bug 618568)#8823
Open
gggdttt wants to merge 1 commit into
Open
Re-enable BCPT Setup Card tests: fix NoOfSqlCallsAreLogged SQL assertion (Bug 618568)#8823gggdttt wants to merge 1 commit into
gggdttt wants to merge 1 commit into
Conversation
… 618568) The very first database access in a session counts 2 extra SQL statements from system tables, so the total NoOfSQLStmts is either the number of iterations or that number + 2. Updated the assertion to accept both, matching the existing pattern in LogsAreGeneratedAfterTheExecution.
88e513d to
237b5ae
Compare
Contributor
Copilot PR ReviewIteration 1 · Outcome: completed Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630 Orchestrator pre-filter (13 file(s) excluded)
Findings produced by the Copilot CLI agent against BCQuality at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Bug AB#618568. The test
NoOfSqlCallsAreLoggedin codeunit 144741 "BCPT Setup Card Test" was disabled during the platform 28.0.44646 uptake (PR 237052) because it started failing:Root cause
The test runs 5 iterations of
BCPT Codeunit With 1 Sql(1 SQL statement each) and assertedNoOfSQLStmts = 5. However, the very first database access in a session also counts 2 extra SQL statements from system tables, making the total either5(iterations) or7(iterations + 2). This is the same non-determinism already documented in the sibling testLogsAreGeneratedAfterTheExecution, which accepts[0, 2]for a single entry.AvgSQLStmtsis computed via integer division (GetAvgSQLStmts=No. of SQL Statements div No. of Iterations), so7 div 5 = 1and5 div 5 = 1— the average assertion is unaffected.Solution
Updated the assertion to accept the total being either the actual number of iterations or that number + 2, deriving the expectation from the measured iteration count rather than a hard-coded
5.Changes
src/Tools/Performance Toolkit/Test/src/BCPTSetupCardTest.Codeunit.al: tolerantNoOfSQLStmtsassertion inNoOfSqlCallsAreLogged.Testing
RunALTestDevTools) once the test is re-enabled (the corresponding NAV-side change removes the DisabledTests entry).Related
App/DisabledTests/BCPTSetupCardTest.DisabledTest.json.