Skip to content

fix: Fix flaky avalonia test#2177

Merged
maximilien-noal merged 1 commit into
masterfrom
flaky_avalonia_tests
May 15, 2026
Merged

fix: Fix flaky avalonia test#2177
maximilien-noal merged 1 commit into
masterfrom
flaky_avalonia_tests

Conversation

@kevinferrare
Copy link
Copy Markdown
Contributor

Description of Changes

Fix flaky avalonia tests

Copilot AI review requested due to automatic review settings May 15, 2026 18:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Replaces [AvaloniaFact] with the standard xUnit [Fact] attribute on UI-related tests that do not actually need a running Avalonia UI thread, removing the associated window show/close and ProcessUiEvents plumbing in StructureViewUiTests. This eliminates flakiness caused by the headless Avalonia dispatcher.

Changes:

  • Switch MouseCaptureTests from [AvaloniaFact] to [Fact] (the backends under test are pure managed/native wrappers, no UI required).
  • Switch StructureViewUiTests from [AvaloniaFact] to [Fact] and drop the StructureView window instantiation, ShowWindowAndWait, view.Close(), and ProcessUiEvents() calls that the view-model-only assertions don't need.
  • Add explicit using Xunit; import in StructureViewUiTests now that the attribute is [Fact].

Reviewed changes

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

File Description
tests/Spice86.Tests/UI/MouseCaptureTests.cs Drops the unused Avalonia.Headless.XUnit import and replaces every [AvaloniaFact] with [Fact].
tests/Spice86.Tests/UI/StructureViewUiTests.cs Adds the Xunit using, replaces [AvaloniaFact] with [Fact], and removes the now-unneeded view show/close and UI-pump calls in the view-model-only test paths.

@maximilien-noal maximilien-noal merged commit 84ec7cb into master May 15, 2026
7 of 8 checks passed
@maximilien-noal maximilien-noal deleted the flaky_avalonia_tests branch May 17, 2026 09:44
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