Repository navigation
Wait for the fresh update check before counting it in the restore test - #188
Merged
Merged
Conversation
RestoringDuringAnOldCheckRunsOneFreshCheckAfterTheOldResponseIsDiscarded failed once in the nightly suite with one check counted instead of two. Restoring the updates feature sets CanCheckApplicationUpdate while the old check is still running, and when the old response arrives, the finally block of CheckApplicationUpdateAvailabilityAsync releases _applicationUpdateOperation before it begins the fresh check. The old response completes on another thread, so WaitForCheckAsync could poll the controller in that window, find it idle, and return before the fresh request was counted. The test now waits for the second request before it waits for the controller to go idle.
Owner
Author
|
Full nightly dispatched on this branch (run 42505910128): the update-check test and the rest of the suite passed except WpfStyleRuntimeTests at the HUD host retry step, an unrelated intermittent failure diagnosed and fixed in #189. PR CI on this branch is green and the merge state is clean. |
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.
Today's scheduled nightly on main (run 42502266063, commit 8b1cee4) failed
ApplicationUpdateCheckPolicyTests.RestoringDuringAnOldCheckRunsOneFreshCheckAfterTheOldResponseIsDiscardedwith one check counted instead of two. The same code passed the nightly dispatched 15 hours earlier.Cause, from the code. Restoring the
updatesfeature control setsCanCheckApplicationUpdatewhile the old check still holds_applicationUpdateOperation. When the old response arrives on a thread-pool thread, thefinallyblock ofCheckApplicationUpdateAvailabilityAsyncreleases the operation slot first and only then restores the status and begins the fresh check. For that moment the controller looks idle:CanCheckApplicationUpdateis true, no operation is active, and one request has been counted. The test'sWaitForCheckAsyncpolls exactly that idle condition every 10 ms, so a poll that lands in the window returns before the fresh request is counted and the next assertion sees 1. The window is microseconds long, which is why the failure is rare and appeared on a loaded runner during the full suite.Change. Test only. The test now waits for the second request before it waits for the controller to go idle. The polling loop moved into a shared
WaitUntilAsynchelper;WaitForCheckAsyncbehaves the same for the other 32 tests in the class. Product code is unchanged.Checked.
Wisp.App.Testsbuilt once and theApplicationUpdateCheckPolicyTestsclass run once on the maintainer PC: 33 passed, 0 failed.Not verified. The failure was not reproduced; that would need a delay injected into the controller's
finallyblock. The diagnosis rests on reading the code and matches the recorded failure, including that the helper's own assertions did not fire. An alternative judged improbable:NetworkInterface.GetIsNetworkAvailable()returning false for the fresh check on the runner would give the same signature. #174 stays open until a scheduled nightly on main passes.