Rig.TUnit.Parallelism 0.1.0-beta.2

This is a prerelease version of Rig.TUnit.Parallelism.
dotnet add package Rig.TUnit.Parallelism --version 0.1.0-beta.2
                    
NuGet\Install-Package Rig.TUnit.Parallelism -Version 0.1.0-beta.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rig.TUnit.Parallelism" Version="0.1.0-beta.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rig.TUnit.Parallelism" Version="0.1.0-beta.2" />
                    
Directory.Packages.props
<PackageReference Include="Rig.TUnit.Parallelism" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Rig.TUnit.Parallelism --version 0.1.0-beta.2
                    
#r "nuget: Rig.TUnit.Parallelism, 0.1.0-beta.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Rig.TUnit.Parallelism@0.1.0-beta.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Rig.TUnit.Parallelism&version=0.1.0-beta.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Rig.TUnit.Parallelism&version=0.1.0-beta.2&prerelease
                    
Install as a Cake Tool

Rig.TUnit.Parallelism

ParallelIsolationContract — family-level suite asserting a provider fixture behaves correctly under concurrent TUnit parallel execution.

What this package is

A small but load-bearing contract suite. Every provider that claims to be parallel-safe must inherit ParallelIsolationContract<TFixture> and register it via [InheritsTests] at the family level. The contract drives N parallel test iterations, observes whether they trample each other's state, and reports both the observed concurrency (did they actually run in parallel?) and the correctness (did they isolate?).

Combined with IsolationKey, this is the package that keeps the "fixtures are parallel-safe" claim honest across 30+ providers.

When to use it

  • Writing a new provider — always add a concrete subclass of ParallelIsolationContract<TFixture> to your integration project.
  • Regression-testing an existing provider that historically needed [NotInParallel] — the contract is how you prove the marker can be removed.
  • Not for: unit tests. The contract is integration-only (spins real fixtures).

Prerequisites

  • .NET 10 SDK
  • Docker Desktop / Colima (the provider's container backend).

Quick start

using Rig.TUnit.Parallelism.Helpers;

var report = await ParallelIsolationHarness.RunAsync(
    iterations: 8,
    buildFixture: () => new InMemoryFixture());

await Assert.That(report.MaxConcurrency).IsGreaterThan(1);
await Assert.That(report.StateCollisions).IsEqualTo(0);

Options

Property Type Default Description
Iterations int 8 Number of parallel test instances.
PerIterationTimeout TimeSpan 30s Max time per concurrent run before harness aborts.
RequireActualParallelism bool true Fail if MaxConcurrency is 1 — that indicates a global lock is serialising work.

Fixture + helper APIs

  • Rig.TUnit.Parallelism.Helpers.ParallelIsolationHarness — test driver
  • Rig.TUnit.Parallelism.Helpers.ParallelIsolationReport — results shape

Per-test isolation

Each iteration runs in its own Task; the harness captures collision evidence (shared mutable state observed) and reports per-iteration timing so a regression (e.g., accidental global lock) is visible immediately.

Parallelism + performance

  • Harness overhead: ~10 ms setup + per-iteration fixture cost.
  • The contract runs every provider's full fixture under Iterations=8 by default; adjust down for expensive providers (Oracle, Cosmos) via config.

Troubleshooting

  • MaxConcurrency=1 — something serialised the runs. Common causes: [NotInParallel] marker, a static readonly SemaphoreSlim shared across fixtures, or a global Docker network with a single bind-port.
  • StateCollisions > 0 — two iterations observed the same container or schema name. Re-check IsolationKey threading in the provider's fixture.

See docs/troubleshooting.md.

Provider quirks + edge cases

  • Kafka's broker port binds a single host port per container — parallelism is bounded by the number of distinct bind-ports you allocate (see Rig.TUnit.Messaging.Kafka's README).
  • Cosmos emulator is Linux-only in its parallel mode; Windows runs serialised (Iterations = 1).

Benchmarks

See ParallelismBenchmarks.cs; tracked in benchmarks/baseline-005.json.

License

MIT. See LICENSE.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Rig.TUnit.Parallelism:

Package Downloads
Rig.TUnit.All

Meta-package containing every Rig.TUnit.* package. DISCOURAGED — prefer per-feature or per-stack meta-packages (Rig.TUnit, Rig.TUnit.Microservices).

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-beta.2 51 4/27/2026
0.0.0-alpha.0.14 45 4/26/2026