From 71aead9a5c9add30dd44002009154d0fcfd066e8 Mon Sep 17 00:00:00 2001 From: filzrev <103790468+filzrev@users.noreply.github.com> Date: Fri, 2 Oct 2026 17:36:27 +0900 Subject: [PATCH] chore: skip disassembler tests on macos(x64) --- .../DisassemblyDiagnoserTests.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/BenchmarkDotNet.IntegrationTests/DisassemblyDiagnoserTests.cs b/tests/BenchmarkDotNet.IntegrationTests/DisassemblyDiagnoserTests.cs index 943f37ef27..f9cd44a026 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/DisassemblyDiagnoserTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/DisassemblyDiagnoserTests.cs @@ -22,9 +22,16 @@ public class DisassemblyDiagnoserTests : BenchmarkTestExecutor { public DisassemblyDiagnoserTests(ITestOutputHelper output) : base(output) { } + // Helper property to skip test on `macos(x64)` because InProcessEmitToolchain test randomly failed on CI. + // See: https://github.com/dotnet/BenchmarkDotNet/issues/3086 + private static bool IsRunningOnMacosX64 + => OsDetector.IsMacOS() && RuntimeInformation.GetCurrentPlatform() is Platform.X64; + public static IEnumerable GetAllJits() { - yield return [JitInfo.GetCurrentJit(), RuntimeInformation.GetCurrentPlatform(), InProcessEmitToolchain.Default]; // InProcess + // Add InProcessEmitToolchain except for macos(x64) + if (!IsRunningOnMacosX64) + yield return [JitInfo.GetCurrentJit(), RuntimeInformation.GetCurrentPlatform(), InProcessEmitToolchain.Default]; // InProcess if (ContinuousIntegration.IsGitHubDraftPR()) yield break; @@ -226,6 +233,9 @@ public class WithTwoBenchmarks [Fact] public void InProcessDisassemblyTargetsTheRunnableOfEachBenchmark() { + if (IsRunningOnMacosX64) + return; // TODO: Replace to use Assert.Skip after migrated to xunit v3 + var disassemblyDiagnoser = new DisassemblyDiagnoser( new DisassemblyDiagnoserConfig(printSource: true, maxDepth: 3)); @@ -250,6 +260,9 @@ public void InProcessDisassemblyTargetsTheRunnableOfEachBenchmark() [Fact] public void InProcessDisassemblyIgnoresRunnablesOfEarlierRuns() { + if (IsRunningOnMacosX64) + return; // TODO: Replace to use Assert.Skip after migrated to xunit v3 + CanExecute(ManualConfig.CreateEmpty() .AddJob(Job.Dry.WithToolchain(InProcessEmitToolchain.Default)) .AddLogger(new OutputLogger(Output))