Conversation
Give the foreground transition one bounded settling interval before a final focus nudge and recheck. The assertion still fails with the last observed UIA focus data when the row never converges. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Colin Neilens <coneilen@microsoft.com>
The prior single trailing-nudge fix still failed on windows-spikes with the same symptom (focused=Text Area:Text Area), indicating a delayed activation-driven refocus of the terminal Text Area lands *after* our SetFocus call and before we sample FocusedElement, not merely before the loop starts. Reorder each polling iteration to settle briefly after ActivateWindow before calling SetFocus, so our focus assertion is the last action before sampling. Keep the loop's overall ~30s budget and hard failure/diagnostics unchanged; apply the same reordering to the final bounded nudge. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Colin Neilens <coneilen@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Colin Neilens <coneilen@microsoft.com>
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.
Summary
Hardens the Windows native UI Automation worktree-row focus assertion against shared CI desktop-focus churn without weakening the assertion or changing product behavior.
Changes
ActivateWindowbefore callingSetFocus, so the row's focus assertion is the last action before samplingFocusedElement.Notes on iteration
A first attempt (commit
7db72cd) only added a trailing final nudge without reordering; it still reproduced the failure on hostedwindows-spikes(https://github.com/scgopi/GraphCode/actions/runs/35476483960/job/105986495560) with the identical symptom, showing the interfering refocus lands afterSetFocusinside every loop iteration, not only at the loop boundary. Commita3d6910reorders each iteration accordingly.Test plan
RED:
Tools/windows/validate.ps1 -Task all -SkipTrayLive -SkipWslRemoteE2Eon PR #387 commit1ed41ca-> failed inwindows-spikeswithworktree row could not retain focus against concurrent desktop focus changes; focused=Text Area:Text Area(https://github.com/scgopi/GraphCode/actions/runs/35475073552/job/105985602192)GREEN: PowerShell parser on
Tools/windows/uia-live-gate.ps1at commita3d6910-> passed with no parse errors;pwsh -NoProfile -File Tools/windows/Tests/ValidationRunner.Tests.ps1-> PASSREGRESSION:
pwsh -NoProfile -File Tools/windows/validate.ps1 -Task windows-shell -SkipTrayLive-> reached the pre-UIA Swift release build and stopped on the known local SDK limitationmissing required modules: '_complex', 'ucrt'; hostedwindows-spikesruns the complete gate and is the authoritative pass/fail signal for this changeChecklist
git commit -s) per the DCOmake test) — not applicable to this Windows-only test-infrastructure change; focused validation is documented abovegit diff --check)