Issue
The buildtest script uses --parallel-algorithm aggressive when running dotnet test. When the repository contains benchmark tests (e.g. FunFair.Ethereum.DataTypes.BenchMark.Tests) that take 3-4 minutes to complete, the aggressive parallelism causes OutOfMemoryException crashes in other test assemblies running concurrently.
Error
Out of memory.
Aborted (core dumped)
✗ ######## Tests Failed ########
Stack trace (from first failure in FunFair.Ethereum.Client.Tests):
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Threading.Tasks.Task.AssignCancellationToken
at Microsoft.DotNet.Cli.Commands.Test.IPC.NamedPipeServer.WaitConnectionAsync
at Microsoft.DotNet.Cli.Commands.Test.TestApplication.WaitConnectionAsync
Context
- Source repository:
funfair-tech/funfair-server-ethereum
- The
DataTypes.BenchMark.Tests take ~4 minutes and consume significant memory
- With
--parallel-algorithm aggressive, all test assemblies (including benchmarks) start at the same time
- This exhausts available memory, causing random OOM crashes in other assemblies depending on timing
Observed behaviour
The failure is non-deterministic — different test assemblies OOM on different runs:
- First run:
FunFair.Ethereum.Client.Tests OOMs
- Second run:
FunFair.Ethereum.Blocks.Stream.Tests OOMs
Proposed fix
Either:
- Exclude benchmark test assemblies from the pre-commit test run (they are not appropriate for every commit anyway), or
- Use a less aggressive parallel algorithm (e.g.
--parallel-algorithm sequential or no parallel flag) when benchmark tests are present, or
- Add a flag to skip benchmarks: only run
*.Tests assemblies, not *.BenchMark.Tests
Label: AI-Work
Issue
The
buildtestscript uses--parallel-algorithm aggressivewhen runningdotnet test. When the repository contains benchmark tests (e.g.FunFair.Ethereum.DataTypes.BenchMark.Tests) that take 3-4 minutes to complete, the aggressive parallelism causesOutOfMemoryExceptioncrashes in other test assemblies running concurrently.Error
Stack trace (from first failure in FunFair.Ethereum.Client.Tests):
Context
funfair-tech/funfair-server-ethereumDataTypes.BenchMark.Teststake ~4 minutes and consume significant memory--parallel-algorithm aggressive, all test assemblies (including benchmarks) start at the same timeObserved behaviour
The failure is non-deterministic — different test assemblies OOM on different runs:
FunFair.Ethereum.Client.TestsOOMsFunFair.Ethereum.Blocks.Stream.TestsOOMsProposed fix
Either:
--parallel-algorithm sequentialor no parallel flag) when benchmark tests are present, or*.Testsassemblies, not*.BenchMark.TestsLabel: AI-Work