From 56de9e766bb6995a8916abc93e1019f8da54769e Mon Sep 17 00:00:00 2001 From: Stefan Nikolei Date: Wed, 8 Mar 2023 07:07:03 +0100 Subject: [PATCH] Disable MemoryAllocator tests --- .../UniformUnmanagedMemoryPoolTests.Trim.cs | 4 +- .../UniformUnmanagedMemoryPoolTests.cs | 4 +- ...niformUnmanagedPoolMemoryAllocatorTests.cs | 40 +++++++++++-------- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.Trim.cs b/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.Trim.cs index 08f6409e38..c0e478b6e3 100644 --- a/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.Trim.cs +++ b/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.Trim.cs @@ -53,11 +53,11 @@ public partial class UniformUnmanagedMemoryPoolTests [Collection(nameof(NonParallelCollection))] public class NonParallel { - // public static readonly bool IsNotMacOS = !TestEnvironment.IsMacOS; + public static readonly bool IsNotMacOS = !TestEnvironment.IsMacOS; // TODO: Investigate failures on macOS. All handles are released after GC. // (It seems to happen more consistently on .NET 6.) - // [ConditionalFact(nameof(IsNotMacOS))] + [ConditionalFact(nameof(IsNotMacOS))] [Fact] public void MultiplePoolInstances_TrimPeriodElapsed_AllAreTrimmed() { diff --git a/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.cs b/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.cs index 4e7244d5fc..69fc1a5f7d 100644 --- a/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.cs +++ b/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.cs @@ -238,10 +238,10 @@ public partial class UniformUnmanagedMemoryPoolTests cleanup.Register(b1); } - // public static readonly bool IsNotMacOS = !TestEnvironment.IsMacOS; + public static readonly bool IsNotMacOS = !TestEnvironment.IsMacOS; // TODO: Investigate macOS failures - // [ConditionalTheory(nameof(IsNotMacOS))] + [ConditionalTheory(nameof(IsNotMacOS))] [InlineData(false)] [InlineData(true)] public void RentReturnRelease_SubsequentRentReturnsDifferentHandles(bool multiple) diff --git a/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedPoolMemoryAllocatorTests.cs b/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedPoolMemoryAllocatorTests.cs index 3eea8516af..3403e3f17e 100644 --- a/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedPoolMemoryAllocatorTests.cs +++ b/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedPoolMemoryAllocatorTests.cs @@ -255,11 +255,11 @@ public class UniformUnmanagedPoolMemoryAllocatorTests [InlineData(1200)] // Group of two UniformUnmanagedMemoryPool buffers public void AllocateMemoryGroup_Finalization_ReturnsToPool(int length) { - // if (TestEnvironment.IsMacOS) - // { - // // Skip on macOS: https://github.com/SixLabors/ImageSharp/issues/1887 - // return; - // } + if (TestEnvironment.IsMacOS) + { + // Skip on macOS: https://github.com/SixLabors/ImageSharp/issues/1887 + return; + } if (TestEnvironment.OSArchitecture == Architecture.Arm64) { @@ -267,12 +267,12 @@ public class UniformUnmanagedPoolMemoryAllocatorTests return; } - // if (!TestEnvironment.RunsOnCI) - // { - // // This may fail in local runs resulting in high memory load. - // // Remove the condition for local debugging! - // return; - // } + if (!TestEnvironment.RunsOnCI) + { + // This may fail in local runs resulting in high memory load. + // Remove the condition for local debugging! + return; + } // RunTest(length.ToString()); RemoteExecutor.Invoke(RunTest, length.ToString()).Dispose(); @@ -323,18 +323,24 @@ public class UniformUnmanagedPoolMemoryAllocatorTests [InlineData(600)] // Group of single UniformUnmanagedMemoryPool buffer public void AllocateSingleMemoryOwner_Finalization_ReturnsToPool(int length) { + if (TestEnvironment.IsMacOS) + { + // Skip on macOS: https://github.com/SixLabors/ImageSharp/issues/1887 + return; + } + if (TestEnvironment.OSArchitecture == Architecture.Arm64) { // Skip on ARM64: https://github.com/SixLabors/ImageSharp/issues/2342 return; } - // if (!TestEnvironment.RunsOnCI) - // { - // // This may fail in local runs resulting in high memory load. - // // Remove the condition for local debugging! - // return; - // } + if (!TestEnvironment.RunsOnCI) + { + // This may fail in local runs resulting in high memory load. + // Remove the condition for local debugging! + return; + } // RunTest(length.ToString()); RemoteExecutor.Invoke(RunTest, length.ToString()).Dispose();