Fix Azure AD user-sync test failing in NAV uptake gate (bug 637527)#8483
Open
Groenbech96 wants to merge 2 commits into
Open
Fix Azure AD user-sync test failing in NAV uptake gate (bug 637527)#8483Groenbech96 wants to merge 2 commits into
Groenbech96 wants to merge 2 commits into
Conversation
… gate (bug 637527) Initialize() deletes existing User records, which in the System DACPAC test environment (seeds the MSOLSYNC daemon user, runs with TestIsolation Disabled) deletes a real row and opens a write transaction. The subsequent ApplyUpdatesFromAzureGraph raises the isolated OnApplyUpdateFromAzureGraph event inside that write transaction, so the subscriber error is not isolated and the "User does not exist" error propagates instead of being recorded on the buffer. Commit after Initialize() so the event is raised outside a write transaction. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Could not find a linked ADO work item. Please link one by using the pattern 'AB#' followed by the relevant work item number. You may use the 'Fixes' keyword to automatically resolve the work item when the pull request is merged. E.g. 'Fixes AB#1234' |
Contributor
Author
|
@copilot Merge main into branch |
…usersync-test-commit
Contributor
Merged |
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.
Summary
Fixes
TestFailedUpdateRecordsErrorMessageOnBuffer(codeunit 132928Azure AD User Sync Test) failing in the NAV uptake gate (RunALTestSystemModules_Group1), tracked as ADO bug 637527.Root cause
The test exercises the error-on-buffer path added in #8393 ("Surface errors from failed M365 user-sync updates in the wizard"): a failed per-user update should have its error recorded on the buffer via the isolated
OnApplyUpdateFromAzureGraphevent, not propagate.Initialize()callsUser.DeleteAll(). In the System Application test environment the database is built from the System DACPAC, which seeds theMSOLSYNCdaemon user (Eng/Core/Scripts/ExportSystemDacpac.ps1→CreateMSOnlineSyncDaemonUser.ps1, kept viaRemove-NavTenantDatabaseUserData -KeepUsers). SoUser.DeleteAll()deletes a real row and opens a write transaction.ApplyUpdatesFromAzureGraphthen raises the isolated event inside that write transaction, where the subscriber error cannot be isolated — soUser.Getthrows "The User does not exist" and it propagates, failing the test.This stayed green wherever the
Usertable was empty (DeleteAllis a no-op → no write transaction), which is why it passed before the NAV uptake.Fix
Commit()afterInitialize()so the event is raised outside a write transaction, matching the requirement already documented in the test's own comment.ADO: 637527