Fix flaky InstallerFunctionalTests::RunInstallerAndVerifyPackages: retry package removal#6467
Open
v-arlysenko wants to merge 3 commits intomicrosoft:mainfrom
Open
Conversation
…n setup failure - Add retry logic (3 attempts, 1s delay) to RemovePackage() for transient 'package in use' errors - Add VerifyAllPackagesRemoved() to detect when removal silently fails - MethodInit now blocks the test with a clear setup error message instead of letting it proceed and fail misleadingly - MethodUninit logs a warning on incomplete cleanup Fixes AB#61461238
Author
|
@microsoft-github-policy-service agree company="Microsoft" |
alexlamtest
approved these changes
May 8, 2026
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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 a flaky failure in
InstallerFunctionalTests::RunInstallerAndVerifyPackagescaused by a transient package-removal race during test setup/cleanup.
Internal work item: AB#61461238
Changes
installer/test/InstallerFunctionalTests/constants.hAdded retry constants (5 attempts × 5s = up to 25s).
installer/test/InstallerFunctionalTests/helpers.cppRewrote
RemovePackage()with a retry loop. TreatsERROR_NOT_FOUNDassuccess; sleeps
c_packageRemovalRetryDelayMsbetween attempts ontransient failures; logs a warning on final failure.
Added
VerifyAllPackagesRemoved()to validate cleanup state.installer/test/InstallerFunctionalTests/helpers.hDeclared
VerifyAllPackagesRemoved().installer/test/InstallerFunctionalTests/FunctionalTests.cppMethodInitnow blocks the test (Log::Error+return false) whenpre-existing packages cannot be removed, so TAEF reports it as a setup
block rather than a test failure.
MethodUninitlogs a warning onincomplete cleanup.
Validation
InstallerFunctionalTestslocally; transient cleanup failures arenow retried and the test no longer flakes.