PackageManager test apps: retry OpenEventW briefly before giving up - #6695
Draft
Vineeth Thomas Alex (vineeththomasalex) wants to merge 1 commit into
Draft
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
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.
What
Adds a bounded retry (5s budget, 50ms poll interval) around
OpenEventWin the two PackageManagertest apps (
PackageManager.Test.M.Black.msix,PackageManager.Test.M.Blacker.msix) before fallingback to the existing failure behavior (
RETURN_LAST_ERROR_IF_NULL, immediate exit).Why
Follow-up to the investigation into the residual
PackageDeploymentManagerTests_IsPackageRegistrationPendingfailures (
IsPackageRegistrationPending_Pending/IsPackageRegistrationPendingForUser_Pending),which fail deterministically on every CI config where
InteractiveExperiencesis built from sourcein the monobuild (they pass on stub IXP builds).
Exhaustive local investigation ruled out every code-level and timing-level hypothesis:
PackageManagement_IsPackageRegistrationPendingFrameworkUdk export — correct in bothstub and source-built DLL variants (direct P/Invoke, single-call and same-process-ordering tests).
Microsoft.WindowsAppRuntime.dllWinRT wrapper — correct (directDllGetActivationFactoryharness, both DLL variants).ActivateApplicationand the deferred install — correct with zeroartificial delay, tested via both PowerShell and a fully-native C++ harness replicating the real
test's exact call sequence.
PackageDeploymentManagerTests_Register's ClassSetup cascade polluting this class — ruled out:the failure occurs on
Windows.10.Enterprise.LTSC.2021(a config with zero_Registercascade failures), and
_IsPackageRegistrationPending's tests run and complete before any_Registertest starts.PackageManagerTests.dllsource and ran it via real
te.exeon an IXPTools VM. Passed 4/4 consecutive runs, zeromodifications to any test file.
The one concrete fragility found: this app's
WinMainparses its activation argument as an eventname and calls
OpenEventWexactly once. If that ever transiently fails to see the caller'sCreateEventW-created event (e.g. a broker/activation-scheduling timing variance specific to someCI execution contexts, not reproduced in this investigation's VM), the app exits almost instantly
instead of holding the package "in use" — producing exactly the observed symptom: no exception, no
error,
IsPackageRegistrationPending()correctly (from the OS's perspective) reports nothingpending because the deferred upgrade already silently completed.
Honest scope of this change
This is defensive hardening for an identified robustness gap, not a proven fix for a fully
confirmed root cause. The CI-specific trigger mechanism could not be force-reproduced locally
despite exhausting every constructible hypothesis. If a CI run with this change still fails the
same way, that's meaningful evidence the real cause lies elsewhere (e.g. a CloudTest-infrastructure
scheduling/session issue outside this app's control) — this change should still stand on its own
merits as a legitimate improvement to test-app robustness.
Test-infrastructure only
Only the two MSIX test app
winmain.cppfiles change (identical diff in both, 15 lines added each).No product code changes.
Local verification
PackageDeploymentManagerTests_IsPackageRegistrationPendingclass (8 methods,including both
_Pendingvariants) via realte.exeagainst the real, unmodified test binary andreal MSIX/Framework/Bootstrap infrastructure on an IXPTools VM: 8/8 Passed, 0 Failed, no
regression from the added retry loop in the already-passing case.
Separate from #6693 (the cascading
ERROR_PACKAGES_IN_USEfix, out of scope here per that PR's own"no need to fix it in this PR" guidance for these residual tests).