From fd655e6bfa747c98bf2892e295af250244fbadfe Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 30 Dec 2025 16:10:01 +0000 Subject: [PATCH] fix: Use explicit solution file in DotNetTests to prevent flaky failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- test/ModularPipelines.UnitTests/Helpers/DotNetTests.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/ModularPipelines.UnitTests/Helpers/DotNetTests.cs b/test/ModularPipelines.UnitTests/Helpers/DotNetTests.cs index d5f078d4ab..65f0bffb57 100644 --- a/test/ModularPipelines.UnitTests/Helpers/DotNetTests.cs +++ b/test/ModularPipelines.UnitTests/Helpers/DotNetTests.cs @@ -15,9 +15,11 @@ private class DotNetVersionModule : Module { public override async Task ExecuteAsync(IModuleContext context, CancellationToken cancellationToken) { + // Use main solution explicitly - FindFile returns first match alphabetically + // which could be ModularPipelines.Analyzers.sln causing flaky failures return await context.DotNet().List.Package(new DotNetListPackageOptions { - ProjectSolution = context.Git().RootDirectory.FindFile(x => x.Extension == ".sln").AssertExists(), + ProjectSolution = context.Git().RootDirectory.FindFile(x => x.Name == "ModularPipelines.sln").AssertExists(), }, token: cancellationToken); } }