Repository navigation
[API tests] End tenant sessions before dropping clean test tenant databases - #12777
Prangshuman Das (t-prda) wants to merge 2 commits into
Conversation
|
The web service key is held in a Text variable while it is retrieved and checked, making the credential visible to debugger inspection and other plain-text handling. Keep the value as SecretText from the Identity Management retrieval through the authentication consumer; the [NonDebuggable] attribute does not replace the required SecretText credential type. Knowledge: Posting this finding as an issue comment because inline comment placement failed. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.50.6 |
|
The enum value with ordinal 1 was removed without an ObsoleteState = Pending -> Removed transition. Existing persisted rows using ordinal 1 can no longer resolve to the same enum member after the extension upgrade. Preserve the ordinal and obsolete the value with an ObsoleteReason and ObsoleteTag instead of deleting it. Knowledge: Posting this finding as an issue comment because inline comment placement failed. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.50.6 |
24c7b43 to
8185669
Compare
8185669 to
e216440
Compare
e216440 to
9bc8418
Compare
9bc8418 to
2c0c104
Compare
2c0c104 to
3557bc7
Compare
3557bc7 to
aab8e4a
Compare
aab8e4a to
2d40b1d
Compare
Reset-BcTestTenant removed the tenant database with the container's Remove-NavDatabase, which takes the database offline with ROLLBACK IMMEDIATE and no query timeout. Intermittently a leftover session kept tenant2 in use and the removal blocked for about 30 minutes (the server's SQL command timeout), stretching a test job by up to two hours. End the tenant's server sessions before dismounting, then drop the database with one bounded query (120 seconds, retried) that kills the remaining user sessions on it, switches to SINGLE_USER and drops it. Log the ended sessions and the drop time so any remaining stall is diagnosable. AB#646383 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Get-NAVServerSession also returns internal sessions with negative IDs, which Remove-NAVServerSession rejects. The first one aborted the loop, so tenant sessions were not ended on most refreshes in CI. Only end sessions with a non-negative ID and end each one independently. AB#646383 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
2d40b1d to
7048602
Compare
Review focus:
Reset-BcTestTenantinbuild/scripts/ParallelTestExecution.psm1(+ Pester tests).Area fix: deterministic clean-tenant refresh. Before each
RequiredTestIsolation=Disabledcodeunit, clean-tenant execution drops and re-copies the worker tenant database. The container'sRemove-NavDatabaserunsALTER DATABASE ... SET OFFLINE WITH ROLLBACK IMMEDIATEwith no query timeout. In stack runs it intermittently blocked for 1,763-1,785 s ontenant2(the server's 30-minute SQL command timeout), e.g. 4x in one IS IntegrationTests job on #12684, adding about 2 hours to that job.Change:
Remove-NAVServerSession) beforeDismount-NAVTenant.Remove-NAVDatabasewith one bounded query (120 s timeout, existing 3 retries): kill the remaining user SQL sessions on the database (by context and by held locks),SET SINGLE_USER WITH ROLLBACK IMMEDIATE,DROP DATABASE. It does nothing when the database does not exist.Validation: Pester 89/89. The T-SQL ran against SQL LocalDB with one connection holding an open transaction in the database and another idle in it: both sessions were ended and the database dropped in 0.17 s. Rerunning on a missing database is a no-op.
Related: AB#646383
Stack (each PR shows only its own layer; merge bottom first)
main)