Skip to content

Fix the theme-test race behind last night's CI failure on main - #22

Merged
thefinder808 merged 1 commit into
mainfrom
fix/theme-test-race
Jul 10, 2026
Merged

thefinder808 merged 1 commit into
mainfrom
fix/theme-test-race

Conversation

@thefinder808

Copy link
Copy Markdown
Owner

Summary

The Run failed: CI - main (bb17a15) email was a test-suite race, not a product bug — nothing about v2.0.0 or the dependency bumps is broken.

Mechanism: SmokeTests.Theme_variant_matches_the_saved_setting compared the process-global theme variant against AppSettings.Load(). AppSettings.BaseDirOverride is a static test seam, and the AppSettingsTests fixtures (plain [Fact]s that xUnit runs in a parallel collection) point it at a sandbox where they save Theme = "Midnight". When the theme test's Load() landed inside that window it expected Dark against a Light window. Timing-dependent — it passed on every prior run and flaked on the #21 merge push.

Fix:

  • The theme test is now hermetic: its own sandboxed settings, asserting both variants deterministically (a strictly stronger test).
  • [assembly: CollectionBehavior(DisableTestParallelization = true)] for the App test assembly — these tests share Application.Current and the static override, so parallel collections were never sound. The suite runs in ~1 s; serialization costs nothing.

Verification: full App suite run 10/10 consecutive green locally; the failed main run has been re-run and should clear.

🤖 Generated with Claude Code

Theme_variant_matches_the_saved_setting read AppSettings.Load() while
AppSettingsTests — running in a parallel xUnit collection — had the
static BaseDirOverride pointed at a sandbox with Theme=Midnight, so the
test intermittently expected Dark against a Light window. Now hermetic
(its own sandboxed settings, asserting both variants), and the assembly
disables test parallelization outright: these tests share
Application.Current and the static override, so parallel collections
were never sound. App suite verified 10/10 consecutive green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@thefinder808
thefinder808 merged commit 40b84bd into main Jul 10, 2026
1 check passed
@thefinder808
thefinder808 deleted the fix/theme-test-race branch July 10, 2026 16:35
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