Skip to content

fix: Fix another round of avalonia flaky tests#2178

Merged
kevinferrare merged 1 commit into
masterfrom
fix/flaky_avalonia_tests_again
May 15, 2026
Merged

fix: Fix another round of avalonia flaky tests#2178
kevinferrare merged 1 commit into
masterfrom
fix/flaky_avalonia_tests_again

Conversation

@kevinferrare

Copy link
Copy Markdown
Contributor

Description of Changes

Rationale behind Changes

Suggested Testing Steps

Copilot AI review requested due to automatic review settings May 15, 2026 18:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to reduce Avalonia headless UI test flakiness by ensuring that deferred UI-thread work triggered by window closure is processed before the test tears down.

Changes:

  • Added a shared CloseWindowAndWait helper to close windows and pump pending UI events.
  • Updated UI tests to use the new helper for deterministic cleanup.
  • Ensured the headless infrastructure smoke test also pumps dispatcher jobs after closing.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/Spice86.Tests/UI/MemoryViewUiTests.cs Uses CloseWindowAndWait for window cleanup after async UI interactions.
tests/Spice86.Tests/UI/HeadlessInfrastructureTests.cs Pumps Dispatcher.UIThread jobs after closing the test window to reduce teardown races.
tests/Spice86.Tests/UI/BreakpointUiTestBase.cs Introduces CloseWindowAndWait (Close + ProcessUiEvents) as a shared stabilization helper.
tests/Spice86.Tests/UI/BreakpointsViewUiTests.cs Replaces direct window.Close() calls with CloseWindowAndWait across the test suite.

@kevinferrare kevinferrare merged commit ea06b62 into master May 15, 2026
9 checks passed
@kevinferrare kevinferrare deleted the fix/flaky_avalonia_tests_again branch May 15, 2026 18:56
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.

3 participants