Skip to content

Commit

Permalink
Moved MemoryDiagnoserTests to ManualRunning to stabilize CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
timcassell committed Apr 28, 2024
1 parent f6a4194 commit 0da5eba
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions ....IntegrationTests/MemoryDiagnoserTests.cs → ...sts.ManualRunning/MemoryDiagnoserTests.cs 100755 → 100644
Expand Up @@ -24,8 +24,11 @@
using Xunit.Abstractions;
using BenchmarkDotNet.Toolchains.Mono;

namespace BenchmarkDotNet.IntegrationTests
namespace BenchmarkDotNet.IntegrationTests.ManualRunning
{
// #1925
// These tests were moved to ManualRunning to stabilize the CI.
// Even after disabling tiered jit and blocking the finalizer thread, the tests are still flaky on CI.
public class MemoryDiagnoserTests
{
private readonly ITestOutputHelper output;
Expand All @@ -51,7 +54,6 @@ public class AccurateAllocations
}

[Theory, MemberData(nameof(GetToolchains))]
[Trait(Constants.Category, Constants.BackwardCompatibilityCategory)]
public void MemoryDiagnoserIsAccurate(IToolchain toolchain)
{
long objectAllocationOverhead = IntPtr.Size * 2; // pointer to method table + object header word
Expand Down Expand Up @@ -109,7 +111,6 @@ private void AllocateUntilGcWakesUp()
}

[Theory, MemberData(nameof(GetToolchains))]
[Trait(Constants.Category, Constants.BackwardCompatibilityCategory)]
public void MemoryDiagnoserDoesNotIncludeAllocationsFromSetupAndCleanup(IToolchain toolchain)
{
AssertAllocations(toolchain, typeof(AllocatingGlobalSetupAndCleanup), new Dictionary<string, long>
Expand All @@ -135,7 +136,6 @@ public ulong TimeConsuming()
}

[Theory, MemberData(nameof(GetToolchains))]
[Trait(Constants.Category, Constants.BackwardCompatibilityCategory)]
public void EngineShouldNotInterfereAllocationResults(IToolchain toolchain)
{
AssertAllocations(toolchain, typeof(NoAllocationsAtAll), new Dictionary<string, long>
Expand All @@ -146,7 +146,6 @@ public void EngineShouldNotInterfereAllocationResults(IToolchain toolchain)

// #1542
[Theory, MemberData(nameof(GetToolchains))]
[Trait(Constants.Category, Constants.BackwardCompatibilityCategory)]
public void TieredJitShouldNotInterfereAllocationResults(IToolchain toolchain)
{
AssertAllocations(toolchain, typeof(NoAllocationsAtAll), new Dictionary<string, long>
Expand All @@ -162,7 +161,6 @@ public class NoBoxing
}

[Theory, MemberData(nameof(GetToolchains))]
[Trait(Constants.Category, Constants.BackwardCompatibilityCategory)]
public void EngineShouldNotIntroduceBoxing(IToolchain toolchain)
{
AssertAllocations(toolchain, typeof(NoBoxing), new Dictionary<string, long>
Expand All @@ -183,7 +181,6 @@ public class NonAllocatingAsynchronousBenchmarks
}

[Theory, MemberData(nameof(GetToolchains))]
[Trait(Constants.Category, Constants.BackwardCompatibilityCategory)]
public void AwaitingTasksShouldNotInterfereAllocationResults(IToolchain toolchain)
{
AssertAllocations(toolchain, typeof(NonAllocatingAsynchronousBenchmarks), new Dictionary<string, long>
Expand All @@ -208,7 +205,6 @@ public void WithOperationsPerInvoke()
}

[Theory, MemberData(nameof(GetToolchains))]
[Trait(Constants.Category, Constants.BackwardCompatibilityCategory)]
public void AllocatedMemoryShouldBeScaledForOperationsPerInvoke(IToolchain toolchain)
{
long objectAllocationOverhead = IntPtr.Size * 2; // pointer to method table + object header word
Expand All @@ -234,7 +230,6 @@ public byte[] SixtyFourBytesArray()
}

[TheoryEnvSpecific("Full Framework cannot measure precisely enough for low invocation counts.", EnvRequirement.DotNetCoreOnly), MemberData(nameof(GetToolchains))]
[Trait(Constants.Category, Constants.BackwardCompatibilityCategory)]
public void AllocationQuantumIsNotAnIssueForNetCore21Plus(IToolchain toolchain)
{
long objectAllocationOverhead = IntPtr.Size * 2; // pointer to method table + object header word
Expand Down Expand Up @@ -300,7 +295,6 @@ public void Allocate()

[TheoryEnvSpecific("Full Framework cannot measure precisely enough", EnvRequirement.DotNetCoreOnly)]
[MemberData(nameof(GetToolchains))]
[Trait(Constants.Category, Constants.BackwardCompatibilityCategory)]
public void MemoryDiagnoserIsAccurateForMultiThreadedBenchmarks(IToolchain toolchain)
{
long objectAllocationOverhead = IntPtr.Size * 2; // pointer to method table + object header word
Expand All @@ -325,12 +319,8 @@ private void AssertAllocations(IToolchain toolchain, Type benchmarkType, Diction
}
catch (MisconfiguredEnvironmentException e)
{
if (ContinuousIntegration.IsLocalRun())
{
output.WriteLine(e.SkipMessage);
return;
}
throw;
output.WriteLine(e.SkipMessage);
return;
}

foreach (var benchmarkAllocationsValidator in benchmarksAllocationsValidators)
Expand Down

0 comments on commit 0da5eba

Please sign in to comment.