Skip to content

Fix flaky It_generates_satellite_assemblies by decoding captured test stdout as UTF-8 - #55428

Merged
MichaelSimons merged 2 commits into
mainfrom
michaelsimons-fix-satellite-assembly-stdout-encoding
Jul 24, 2026
Merged

Fix flaky It_generates_satellite_assemblies by decoding captured test stdout as UTF-8#55428
MichaelSimons merged 2 commits into
mainfrom
michaelsimons-fix-satellite-assembly-stdout-encoding

Force UTF-8 console output in KitchenSink TestApp for deterministic c…

47785fb
Select commit
Loading
Failed to load commit list.
Build Analysis / Build Analysis succeeded Jul 23, 2026 in 0s

.NET Result Analysis

Details

Tip

To unconditionally bypass the build analysis check (turn it green), you can use the escape mechanism feature. The completion time may vary, potentially taking several minutes, depending on the build analysis workload at the moment.

Test Failures (2 tests failed)

🔹 [All failing tests from dotnet-sdk-public-ci]

    BinaryFormatter_Cast_DiagnosticAsync [Console] [Details] [Artifacts] [0.10% failure rate]
    [ 🚧 Create issue against infrastructure team] [ 📄 Create issue in this repo]

    Failing Configuration

    Exception Message
    Test method Microsoft.NetCore.Analyzers.Security.UnitTests.DataSetDataTableInIFormatterObjectGraphTests.BinaryFormatter_Cast_DiagnosticAsync threw exception:
    NuGet.Protocol.Core.Types.FatalProtocolException: An error occurred while retrieving package metadata for 'Microsoft.NETFramework.ReferenceAssemblies.net472.1.0.2' from source 'nuget.org'. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 504 (Gateway Time-out).
    CallStack
    at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
       at NuGet.Protocol.HttpSource.<>c__DisplayClass15_0`1.<<GetAsync>b__0>d.MoveNext()
    --- End of stack trace from previous location ---
       at NuGet.Common.ConcurrencyUtilities.ExecuteWithFileLockedAsync[T](String filePath, Func`2 action, CancellationToken token)
       at NuGet.Common.ConcurrencyUtilities.ExecuteWithFileLockedAsync[T](String filePath, Func`2 action, CancellationToken token)
       at NuGet.Protocol.HttpSource.GetAsync[T](HttpSourceCachedRequest request, Func`2 processAsync, ILogger log, CancellationToken token)
       at NuGet.Protocol.RegistrationUtility.LoadRanges(HttpSource httpSource, Uri registrationUri, String packageId, VersionRange range, SourceCacheContext cacheContext, ILogger log, CancellationToken token)
       at NuGet.Protocol.ResolverMetadataClient.GetDependencies(HttpSource httpClient, Uri registrationUri, String packageId, VersionRange range, SourceCacheContext cacheContext, ILogger log, CancellationToken token)
       at NuGet.Protocol.ResolverMetadataClient.GetRegistrationInfo(HttpSource httpClient, Uri registrationUri, String packageId, VersionRange range, SourceCacheContext cacheContext, NuGetFramework projectTargetFramework, ILogger log, CancellationToken token)
       at NuGet.Protocol.DependencyInfoResourceV3.ResolvePackage(PackageIdentity package, NuGetFramework projectFramework, SourceCacheContext cacheContext, ILogger log, CancellationToken token)
    --- End of inner exception stack trace ---
       at NuGet.Protocol.DependencyInfoResourceV3.ResolvePackage(PackageIdentity package, NuGetFramework projectFramework, SourceCacheContext cacheContext, ILogger log, CancellationToken token)
       at Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.GetPackageDependenciesAsync(PackageIdentity packageIdentity, NuGetFramework targetFramework, ImmutableArray`1 repositories, SourceCacheContext cacheContext, ILogger logger, Builder dependencies, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/ReferenceAssemblies.cs:line 562
       at Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.ResolveCoreAsync(String language, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/ReferenceAssemblies.cs:line 227
       at Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.ResolveAsync(String language, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/ReferenceAssemblies.cs:line 197
       at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.CreateSolutionAsync(ProjectId projectId, EvaluatedProjectState projectState, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 1586
       at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.CreateProjectImplAsync(EvaluatedProjectState primaryProject, ImmutableArray`1 additionalProjects, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 1401
       at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.CreateProjectAsync(EvaluatedProjectState primaryProject, ImmutableArray`1 additionalProjects, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 1380
       at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.GetSolutionAsync(EvaluatedProjectState primaryProject, ImmutableArray`1 additionalProjects, IVerifier verifier, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 1358
       at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.GetSortedDiagnosticsAsync(EvaluatedProjectState primaryProject, ImmutableArray`1 additionalProjects, ImmutableArray`1 analyzers, IVerifier verifier, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 1081
       at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.VerifyDiagnosticsAsync(EvaluatedProjectState primaryProject, ImmutableArray`1 additionalProjects, DiagnosticResult[] expected, IVerifier verifier, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 449
       at Microsoft.CodeAnalysis.Testing.CodeFixTest`1.RunImplAsync(CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.CodeFix.Testing/CodeFixTest`1.cs:line 311
       at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.RunAsync(CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 172
       at Microsoft.NetCore.Analyzers.Security.UnitTests.DataSetDataTableInIFormatterObjectGraphTests.VerifyCSharpAnalyzerAsync(String source, DiagnosticResult[] expected) in /_/src/Microsoft.CodeAnalysis.NetAnalyzers/tests/Microsoft.CodeAnalysis.NetAnalyzers.UnitTests/Microsoft.NetCore.Analyzers/Security/DataSetDataTableInIFormatterObjectGraphTests.cs:line 257
       at Microsoft.NetCore.Analyzers.Security.UnitTests.DataSetDataTableInIFormatterObjectGraphTests.BinaryFormatter_Cast_DiagnosticAsync() in /_/src/Microsoft.CodeAnalysis.NetAnalyzers/tests/Microsoft.CodeAnalysis.NetAnalyzers.UnitTests/Microsoft.NetCore.Analyzers/Security/DataSetDataTableInIFormatterObjectGraphTests.cs:line 20
       at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestMethodInfo.ExecuteInternalAsync(Object[] arguments, CancellationTokenSource timeoutTokenSource)
    NoDiagnosticForStructWithNoEqualsOverrideAndNoIEquatableImplementationAsync [Console] [Details] [Artifacts] [0.10% failure rate]
    [ 🚧 Create issue against infrastructure team] [ 📄 Create issue in this repo]

    Failing Configuration

    Exception Message
    Test method Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines.UnitTests.EquatableAnalyzerTests.NoDiagnosticForStructWithNoEqualsOverrideAndNoIEquatableImplementationAsync threw exception:
    NuGet.Protocol.Core.Types.FatalProtocolException: An error occurred while retrieving package metadata for 'Microsoft.NETCore.App.Ref.3.1.0' from source 'nuget.org'. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 504 (Gateway Time-out).
    CallStack
    at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
       at NuGet.Protocol.HttpSource.<>c__DisplayClass15_0`1.<<GetAsync>b__0>d.MoveNext()
    --- End of stack trace from previous location ---
       at NuGet.Common.ConcurrencyUtilities.ExecuteWithFileLockedAsync[T](String filePath, Func`2 action, CancellationToken token)
       at NuGet.Common.ConcurrencyUtilities.ExecuteWithFileLockedAsync[T](String filePath, Func`2 action, CancellationToken token)
       at NuGet.Protocol.HttpSource.GetAsync[T](HttpSourceCachedRequest request, Func`2 processAsync, ILogger log, CancellationToken token)
       at NuGet.Protocol.RegistrationUtility.LoadRanges(HttpSource httpSource, Uri registrationUri, String packageId, VersionRange range, SourceCacheContext cacheContext, ILogger log, CancellationToken token)
       at NuGet.Protocol.ResolverMetadataClient.GetDependencies(HttpSource httpClient, Uri registrationUri, String packageId, VersionRange range, SourceCacheContext cacheContext, ILogger log, CancellationToken token)
       at NuGet.Protocol.ResolverMetadataClient.GetRegistrationInfo(HttpSource httpClient, Uri registrationUri, String packageId, VersionRange range, SourceCacheContext cacheContext, NuGetFramework projectTargetFramework, ILogger log, CancellationToken token)
       at NuGet.Protocol.DependencyInfoResourceV3.ResolvePackage(PackageIdentity package, NuGetFramework projectFramework, SourceCacheContext cacheContext, ILogger log, CancellationToken token)
    --- End of inner exception stack trace ---
       at NuGet.Protocol.DependencyInfoResourceV3.ResolvePackage(PackageIdentity package, NuGetFramework projectFramework, SourceCacheContext cacheContext, ILogger log, CancellationToken token)
       at Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.GetPackageDependenciesAsync(PackageIdentity packageIdentity, NuGetFramework targetFramework, ImmutableArray`1 repositories, SourceCacheContext cacheContext, ILogger logger, Builder dependencies, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/ReferenceAssemblies.cs:line 562
       at Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.ResolveCoreAsync(String language, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/ReferenceAssemblies.cs:line 227
       at Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.ResolveAsync(String language, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/ReferenceAssemblies.cs:line 197
       at Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.ResolveAsync(String language, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/ReferenceAssemblies.cs:line 174
       at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.CreateSolutionAsync(ProjectId projectId, EvaluatedProjectState projectState, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 1586
       at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.CreateProjectImplAsync(EvaluatedProjectState primaryProject, ImmutableArray`1 additionalProjects, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 1401
       at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.CreateProjectAsync(EvaluatedProjectState primaryProject, ImmutableArray`1 additionalProjects, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 1380
       at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.GetSolutionAsync(EvaluatedProjectState primaryProject, ImmutableArray`1 additionalProjects, IVerifier verifier, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 1358
       at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.GetSortedDiagnosticsAsync(EvaluatedProjectState primaryProject, ImmutableArray`1 additionalProjects, ImmutableArray`1 analyzers, IVerifier verifier, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 1081
       at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.VerifyDiagnosticsAsync(EvaluatedProjectState primaryProject, ImmutableArray`1 additionalProjects, DiagnosticResult[] expected, IVerifier verifier, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 449
       at Microsoft.CodeAnalysis.Testing.CodeFixTest`1.RunImplAsync(CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.CodeFix.Testing/CodeFixTest`1.cs:line 311
       at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.RunAsync(CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 172
       at Test.Utilities.CSharpCodeFixVerifier`2.VerifyAnalyzerAsync(String source, DiagnosticResult[] expected) in /_/src/Microsoft.CodeAnalysis.NetAnalyzers/tests/Test.Utilities/CSharpCodeFixVerifier`2.cs:line 35
       at Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines.UnitTests.EquatableAnalyzerTests.NoDiagnosticForStructWithNoEqualsOverrideAndNoIEquatableImplementationAsync() in /_/src/Microsoft.CodeAnalysis.NetAnalyzers/tests/Microsoft.CodeAnalysis.NetAnalyzers.UnitTests/Microsoft.CodeQuality.Analyzers/ApiDesignGuidelines/EquatableAnalyzerTests.cs:line 26
       at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestMethodInfo.ExecuteInternalAsync(Object[] arguments, CancellationTokenSource timeoutTokenSource)

Was this helpful? Yes No