Skip to content

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

Merged
v-arlysenko merged 2 commits into
mainfrom
user/v-arlysenko/installer-test-retry-package-removal
May 14, 2026
Merged

Fix flaky InstallerFunctionalTests::RunInstallerAndVerifyPackages: retry package removal#6474
v-arlysenko merged 2 commits into
mainfrom
user/v-arlysenko/installer-test-retry-package-removal

Conversation

@v-arlysenko

Copy link
Copy Markdown
Collaborator

Replaces #6467 (recreated from an upstream branch instead of a fork now that I have contributor access).

Summary

Fixes flaky InstallerFunctionalTests::RunInstallerAndVerifyPackages (AB#61461238) by retrying Remove-AppxPackage during test setup and failing fast when setup cannot reach a clean state.

Root cause

The test removes the previously-installed WinAppSDK package before each run. Remove-AppxPackage is asynchronous in the deployment service and occasionally still has the package registered when the test moves on to reinstall it, causing intermittent failures.

Fix

  • Retry package removal up to 5 attempts (5s apart, 25s total) before giving up.
  • If setup cannot clean the package, fail the test setup explicitly rather than letting the test proceed and produce a misleading verification failure.

Validation

Ran the test locally in a loop (50 iterations) — no failures.

Risk

Low — limited to test-only code (installer/test/InstallerFunctionalTests/).

…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
@agniuks

agniuks commented May 12, 2026

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@agniuks
agniuks requested review from Dreynor87 and ssparach May 12, 2026 22:21
@v-arlysenko
v-arlysenko merged commit 6d969bc into main May 14, 2026
50 checks passed
@v-arlysenko
v-arlysenko deleted the user/v-arlysenko/installer-test-retry-package-removal branch May 14, 2026 14:50
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