Skip to content

Commit 44230eb

Browse files
committed
fix(ci): limit test parallelism on Linux to prevent OOM
TUnit runs tests in parallel by default, which can cause memory pressure and OOM kills on Ubuntu runners. Add --maximum-parallel-tests 1 for Linux only to run tests sequentially. This may increase test time but should prevent the silent process kills.
1 parent 85794cd commit 44230eb

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/build-and-release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,14 @@ jobs:
5555
echo "Starting test run..."
5656
echo "dotnet version: $(dotnet --version)"
5757
echo "Available memory: $(free -h 2>/dev/null || echo 'N/A')"
58+
# On Linux, limit parallelism to prevent OOM kills
59+
MAX_PARALLEL=""
60+
if [[ "$RUNNER_OS" == "Linux" ]]; then
61+
MAX_PARALLEL="--maximum-parallel-tests 1"
62+
fi
5863
dotnet run --project test/NumSharp.UnitTest/NumSharp.UnitTest.csproj \
5964
--configuration Release --no-build --framework net10.0 \
60-
-- --treenode-filter '/*/*/*/*[Category!=OpenBugs]&/*/*/*/*[Category!=HighMemory]' --report-trx
65+
-- --treenode-filter '/*/*/*/*[Category!=OpenBugs]&/*/*/*/*[Category!=HighMemory]' $MAX_PARALLEL --report-trx
6166
6267
- name: Upload Test Results
6368
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)