Skip to content

Fix flaky InstallerFunctionalTests::RunInstallerAndVerifyPackages: retry package removal#6467

Open
v-arlysenko wants to merge 3 commits intomicrosoft:mainfrom
v-arlysenko:installer-test-retry-package-removal
Open

Fix flaky InstallerFunctionalTests::RunInstallerAndVerifyPackages: retry package removal#6467
v-arlysenko wants to merge 3 commits intomicrosoft:mainfrom
v-arlysenko:installer-test-retry-package-removal

Conversation

@v-arlysenko
Copy link
Copy Markdown

Summary

Fixes a flaky failure in InstallerFunctionalTests::RunInstallerAndVerifyPackages
caused by a transient package-removal race during test setup/cleanup.

Internal work item: AB#61461238

Changes

  • installer/test/InstallerFunctionalTests/constants.h
    Added retry constants (5 attempts × 5s = up to 25s).
  • installer/test/InstallerFunctionalTests/helpers.cpp
    Rewrote RemovePackage() with a retry loop. Treats ERROR_NOT_FOUND as
    success; sleeps c_packageRemovalRetryDelayMs between attempts on
    transient failures; logs a warning on final failure.
    Added VerifyAllPackagesRemoved() to validate cleanup state.
  • installer/test/InstallerFunctionalTests/helpers.h
    Declared VerifyAllPackagesRemoved().
  • installer/test/InstallerFunctionalTests/FunctionalTests.cpp
    MethodInit now blocks the test (Log::Error + return false) when
    pre-existing packages cannot be removed, so TAEF reports it as a setup
    block rather than a test failure. MethodUninit logs a warning on
    incomplete cleanup.

Validation

  • Re-ran InstallerFunctionalTests locally; transient cleanup failures are
    now retried and the test no longer flakes.

…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
@v-arlysenko
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Microsoft"

@agniuks
Copy link
Copy Markdown
Contributor

agniuks commented May 8, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants