Skip to content

Synchronize headless UI tests on idle and hit-tested clicks - #4083

Merged
siegfriedpammer merged 2 commits into
masterfrom
test-harness/idle-and-click
Aug 30, 2026
Merged

siegfriedpammer merged 2 commits into
masterfrom
test-harness/idle-and-click

Conversation

@siegfriedpammer

Copy link
Copy Markdown
Member

Stacked on #4082 (its commit is included here until it merges).

The headless UI tests synchronized with the app by pumping a fixed number of frames (39 RunJobs/Delay loops across 19 files) and by pressing at a point computed once from a control's bounds. Both encode how fast the authoring machine was; on the loaded Windows Debug agent the frame count comes up short and the point goes stale, which is the recurring timeout behind the tree context-menu failures (#4080's run, 170aea4, #4082) that were being repaired one test at a time.

  • Waiters.WaitForIdleAsync() replaces the frame loops: no dispatcher job at Background priority or above, no assembly still loading in the background sweep, a frame rendered, on two consecutive polls.
  • Window.ClickAsync(resolveTarget, button, ...) replaces element-targeted MouseDown/MouseUp pairs: re-resolves the target on every poll, presses only once the window's hit test at the click point answers with that target, and reports point + hit visual on timeout.

That diagnostic exposed one vacuous test: User_Click_On_Visible_Row_Does_Not_Recentre_Viewport clicked the centre of a row wider than the tree viewport, which lies under the decompiler text view, so the assertion held without the row ever being clicked. It now clamps to the viewport like the other tree-row clicks and still passes.

Clicks at text positions and press-only gutter clicks stay raw; they do not target an element.

Full ILSpy.Tests (Debug, Linux): 1243 passed / 0 failed, three runs.

This PR was written by an AI agent (Claude Code) under the author's supervision.

Right_Clicking_A_Second_Row_Moves_The_Context_Highlight_To_It still timed
out on the Windows Debug CI job, now in the hit-test wait added for the
second right-click: for the full 60s no hit at the precomputed point matched
the captured row container. A light-dismiss overlay that survives one frame
cannot explain that many rendered frames; a container that is no longer the
one on screen can. The test only waits for three assemblies, so the rest of
the list keeps loading on the slow agent while the test runs, and every
insertion reshuffles the rows - re-realising containers and moving them -
after the row and point were captured.

The wait now resolves the row container and the click point on every poll
and matches the hit by node instead of by container identity, and a timeout
reports the point and what was hit instead so a further failure is
diagnosable from the log.

Assisted-by: Claude:claude-fable-5:Claude Code
The headless UI tests synchronized with the application by pumping a fixed
number of frames (39 loops of RunJobs/Delay across 19 files) and by pressing
at a point computed once from a control's bounds. Both encode how fast the
machine that wrote the test was: on the loaded Windows Debug CI agent the
frame count comes up short and the point goes stale, which is the recurring
timeout in the tree context-menu tests and the reason each such failure was
repaired one test at a time.

Waiters.WaitForIdleAsync replaces the frame loops. It observes the actual
precondition - no dispatcher job queued at Background priority or above, no
assembly still loading in the background sweep, a frame rendered - and
requires it on two consecutive polls so a thread-pool continuation about to
post back is caught as well.

Window.ClickAsync replaces element-targeted MouseDown/MouseUp pairs. It
re-resolves the target on every poll and presses only once the window's hit
test at the click point answers with that target, reporting the point and
what was hit instead on timeout. That diagnostic exposed one vacuous test:
User_Click_On_Visible_Row_Does_Not_Recentre_Viewport clicked the centre of a
row wider than the tree viewport, which lies under the decompiler text view,
so its assertion held without the row ever being clicked. It now clamps the
point to the viewport like the other tree-row clicks.

Clicks at text positions and press-only gutter clicks stay raw; they do not
target an element.

Assisted-by: Claude:claude-fable-5:Claude Code
@siegfriedpammer
siegfriedpammer merged commit 7b75b81 into master Aug 30, 2026
15 checks passed
@siegfriedpammer
siegfriedpammer deleted the test-harness/idle-and-click branch August 30, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant