Skip to content

Commit 808dde5

Browse files
authored
chore: skip flaky test on macos (#2936)
1 parent 047b95d commit 808dde5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -242,16 +242,16 @@ public byte[] SixtyFourBytesArray()
242242
[Trait(Constants.Category, Constants.BackwardCompatibilityCategory)]
243243
public void AllocationQuantumIsNotAnIssueForNetCore21Plus(IToolchain toolchain)
244244
{
245+
// TODO: Skip test on macos. Temporary workaround for https://github.com/dotnet/BenchmarkDotNet/issues/2779
246+
if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.OSX))
247+
return;
248+
245249
long objectAllocationOverhead = IntPtr.Size * 2; // pointer to method table + object header word
246250
long arraySizeOverhead = IntPtr.Size; // array length
247-
int warmupCount = OsDetector.IsMacOS()
248-
? 10 // Workaround setting for macos. https://github.com/dotnet/BenchmarkDotNet/issues/2779
249-
: 0; // Other OS don't need warmup
250-
251251
AssertAllocations(toolchain, typeof(TimeConsuming), new Dictionary<string, long>
252252
{
253253
{ nameof(TimeConsuming.SixtyFourBytesArray), 64 + objectAllocationOverhead + arraySizeOverhead }
254-
}, warmupCount: warmupCount);
254+
});
255255
}
256256

257257
public class MultiThreadedAllocation
@@ -321,9 +321,9 @@ public void MemoryDiagnoserIsAccurateForMultiThreadedBenchmarks(IToolchain toolc
321321
});
322322
}
323323

324-
private void AssertAllocations(IToolchain toolchain, Type benchmarkType, Dictionary<string, long> benchmarksAllocationsValidators, bool disableTieredJit = true, int iterationCount = 1, int warmupCount = 0)
324+
private void AssertAllocations(IToolchain toolchain, Type benchmarkType, Dictionary<string, long> benchmarksAllocationsValidators, bool disableTieredJit = true, int iterationCount = 1)
325325
{
326-
var config = CreateConfig(toolchain, disableTieredJit, iterationCount, warmupCount);
326+
var config = CreateConfig(toolchain, disableTieredJit, iterationCount);
327327
var benchmarks = BenchmarkConverter.TypeToBenchmarks(benchmarkType, config);
328328

329329
var summary = BenchmarkRunner.Run(benchmarks);

0 commit comments

Comments
 (0)