Skip to content

fix: Use explicit solution file in DotNetTests to prevent flaky failures#1682

Merged
thomhurst merged 1 commit into
mainfrom
fix/dotnet-test-solution-selection
Dec 30, 2025
Merged

fix: Use explicit solution file in DotNetTests to prevent flaky failures#1682
thomhurst merged 1 commit into
mainfrom
fix/dotnet-test-solution-selection

Conversation

@thomhurst

Copy link
Copy Markdown
Owner

Summary

  • Fix flaky DotNetTests.Has_Not_Errored test on Windows CI
  • Changed from picking first .sln file alphabetically to explicitly using ModularPipelines.sln

Problem

The test was using:

FindFile(x => x.Extension == ".sln")

This returns the first .sln file alphabetically, which on Windows CI picks ModularPipelines.Analyzers.sln. Running dotnet list package on this solution intermittently fails with exit code -1.

Solution

Explicitly target the main solution file:

FindFile(x => x.Name == "ModularPipelines.sln")

Test plan

  • Build succeeds
  • Windows CI passes consistently

🤖 Generated with Claude Code

The test was using FindFile(x => x.Extension == ".sln") which returns the
first .sln file alphabetically. On Windows CI, this picks ModularPipelines.Analyzers.sln
which can cause `dotnet list package` to fail with exit code -1.

Changed to explicitly use ModularPipelines.sln for consistent behavior.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@thomhurst

Copy link
Copy Markdown
Owner Author

Summary

Fixes flaky test by explicitly targeting the main solution file instead of relying on alphabetical ordering.

Critical Issues

None found ✅

Analysis

The change is straightforward and correct:

Problem identified: The code was using FindFile(x => x.Extension == ".sln") which returns the first match alphabetically. In the repository root, there are three .sln files:

  • ModularPipelines.Analyzers.sln (first alphabetically)
  • ModularPipelines.Examples.sln
  • ModularPipelines.sln (main solution)

On Windows CI, this non-deterministic behavior picked ModularPipelines.Analyzers.sln, causing dotnet list package to fail intermittently.

Solution: Changed to FindFile(x => x.Name == "ModularPipelines.sln") which explicitly targets the main solution file, consistent with CLAUDE.md's documentation (line 10).

Verification:

  • ✅ The fix is minimal and targeted - only changes the problematic line
  • ✅ Comment clearly explains the issue for future maintainers
  • ModularPipelines.sln is documented as the main solution in CLAUDE.md
  • ✅ No security, performance, or architectural concerns
  • ✅ Change aligns with the test's intent (testing dotnet list package on the main solution)

Verdict

APPROVE - No critical issues

@thomhurst thomhurst merged commit 39875ef into main Dec 30, 2025
8 of 12 checks passed
@thomhurst thomhurst deleted the fix/dotnet-test-solution-selection branch December 30, 2025 16:12
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