Skip to content

Commit 10e2e14

Browse files
committed
fix(test): mark large memory tests as [OpenBugs] for CI exclusion
AllocationTests and LongIndexingBroadcastTest cause OOM crashes on CI runners. Marking them as [OpenBugs] excludes them via the existing --treenode-filter in the CI workflow. Changes: - Added [OpenBugs] to AllocationTests class (4 tests allocating 4-44GB) - Added [OpenBugs] to LongIndexingBroadcastTest class (25 tests iterating 2.36B elements) - Removed [SkipOnLowMemory] infrastructure (attribute, tracker, hook) These tests can still be run locally on machines with sufficient memory by running without the OpenBugs filter.
1 parent 2fa9e82 commit 10e2e14

5 files changed

Lines changed: 6 additions & 358 deletions

File tree

test/NumSharp.UnitTest/Backends/Unmanaged/AllocationTests.cs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,22 @@
22
using AwesomeAssertions;
33
using Microsoft.VisualStudio.TestTools.UnitTesting;
44
using NumSharp.Backends;
5-
using NumSharp.UnitTest.Utilities;
65

76
namespace NumSharp.UnitTest.Backends.Unmanaged
87
{
98
/// <summary>
109
/// Tests for large memory allocations.
11-
/// Marked as [HighMemory] because they allocate 1-4GB of memory and
12-
/// can cause OOM on CI runners (especially ubuntu with limited RAM).
10+
/// Marked as [OpenBugs] because they allocate 4-44GB of memory and
11+
/// cause OOM crashes on CI runners.
1312
/// </summary>
1413
[HighMemory]
14+
[OpenBugs]
1515
public class AllocationTests
1616
{
1717
private const long onegb = 1_073_741_824;
1818
private static readonly object _lock = new Object();
1919

2020
[Test]
21-
[HighMemory]
22-
[SkipOnLowMemory(8)] // Actually allocates 4GB (Int32 * 1B elements)
2321
public void Allocate_1GB()
2422
{
2523
lock (_lock)
@@ -31,8 +29,6 @@ public void Allocate_1GB()
3129
}
3230

3331
[Test]
34-
[HighMemory]
35-
[SkipOnLowMemory(12)] // Actually allocates 8GB (Int32 * 2B elements)
3632
public void Allocate_2GB()
3733
{
3834
lock (_lock)
@@ -44,8 +40,6 @@ public void Allocate_2GB()
4440
}
4541

4642
[Test]
47-
[HighMemory]
48-
[SkipOnLowMemory(20)] // Actually allocates 16GB (Int32 * 4B elements)
4943
public void Allocate_4GB()
5044
{
5145
lock (_lock)
@@ -57,9 +51,6 @@ public void Allocate_4GB()
5751
}
5852

5953
[Test]
60-
[HighMemory]
61-
[SkipOnLowMemory(50)] // Actually allocates 44GB+
62-
[OpenBugs]
6354
public void Allocate_44GB()
6455
{
6556
lock (_lock)

test/NumSharp.UnitTest/LongIndexing/LongIndexingBroadcastTest.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Threading.Tasks;
33
using Microsoft.VisualStudio.TestTools.UnitTesting;
44
using NumSharp;
5-
using NumSharp.UnitTest.Utilities;
65
using TUnit.Core;
76

87
namespace NumSharp.UnitTest.LongIndexing;
@@ -22,12 +21,12 @@ namespace NumSharp.UnitTest.LongIndexing;
2221
/// - Operations that produce output (add, multiply, etc.) allocate full-size output arrays
2322
/// even when input is broadcast, causing OutOfMemoryException
2423
///
25-
/// NOTE: Marked [HighMemory] because iterating over 2.36 billion elements causes
24+
/// NOTE: Marked [OpenBugs] because iterating over 2.36 billion elements causes
2625
/// excessive CPU/memory pressure when TUnit runs tests in parallel, leading to
27-
/// OOM kills on Ubuntu CI runners.
26+
/// OOM crashes on CI runners.
2827
/// </summary>
2928
[HighMemory]
30-
[SkipOnLowMemory(12)] // Skip on CI runners with limited memory
29+
[OpenBugs]
3130
public class LongIndexingBroadcastTest
3231
{
3332
/// <summary>

test/NumSharp.UnitTest/Utilities/MemoryMeasurementHook.cs

Lines changed: 0 additions & 174 deletions
This file was deleted.

test/NumSharp.UnitTest/Utilities/SkipOnLowMemoryAttribute.cs

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)