Repository navigation
PackageManager test apps: retry OpenEventW briefly before giving up - #6695
Vineeth Thomas Alex (vineeththomasalex) wants to merge 1 commit into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Combined-fix CI validation (this hardening + #6693 cascade fix) — real pipeline, real source-built IXPValidated this hardening together with #6693''s cascade fix via the monobuild''s targeted rebuild-stage Producer: build 155179455 — Foundation rebuilt from Test-Foundation: build 155187907 ( Result: 228 → 14 total individual test failures across all 12 configs — identical to #6693''s To be clear about what this hardening is and isn''t: this change addresses the most concrete candidate |
|
Closing this in favor of #6693, which now contains both this hardening commit and the cascade fix as a single consolidated PR/branch (merged |
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).