From 653e9b28689cd871188aa79cf96427a539d3a40a Mon Sep 17 00:00:00 2001 From: electricessence <5899455+electricessence@users.noreply.github.com> Date: Sat, 5 Dec 2026 17:28:44 -0800 Subject: [PATCH 1/8] Pin the .NET 11 SDK and opt dotnet test into Microsoft Testing Platform Co-Authored-By: Claude Opus 5.5 --- global.json | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 global.json diff --git a/global.json b/global.json new file mode 100644 index 0000000..7850a46 --- /dev/null +++ b/global.json @@ -0,0 +1,9 @@ +{ + "sdk": { + "version": "11.0.100", + "rollForward": "latestFeature" + }, + "test": { + "runner": "Microsoft.Testing.Platform" + } +} From 2c77e9906c0e05027ce7d9fc0ac7bc91441a02e9 Mon Sep 17 00:00:00 2001 From: electricessence <5899455+electricessence@users.noreply.github.com> Date: Sat, 5 Dec 2026 17:28:44 -0800 Subject: [PATCH 2/8] Add net11.0 target and update dependencies to 11.0.0 - Version 11.0.0. No library source changes. - netstandard dependencies (System.Threading.Channels, System.Collections.Immutable, Microsoft.Bcl.AsyncInterfaces) move from 6.0.0 to 11.0.0. - Remove the explicit Microsoft.SourceLink.GitHub reference: the .NET SDK has included Source Link since .NET 8, and 10.0.300 pulled in a vulnerable Microsoft.Build.Tasks.Git (GHSA-23fw-v26w-5fgq). All PDBs still carry Source Link. - Silence CA1724 (new on net11.0): the public type name Extensions has shipped for years; renaming it would break callers. Co-Authored-By: Claude Opus 5.5 --- .../Open.ChannelExtensions.csproj | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Open.ChannelExtensions/Open.ChannelExtensions.csproj b/Open.ChannelExtensions/Open.ChannelExtensions.csproj index 3eb145e..c11f747 100644 --- a/Open.ChannelExtensions/Open.ChannelExtensions.csproj +++ b/Open.ChannelExtensions/Open.ChannelExtensions.csproj @@ -1,7 +1,7 @@ - netstandard2.0; netstandard2.1; net6.0; net8.0; net9.0; net10.0; + netstandard2.0; netstandard2.1; net6.0; net8.0; net9.0; net10.0; net11.0; latest true AllEnabledByDefault @@ -22,8 +22,8 @@ git true true - 10.0.0 - Lowered .NET Standard 2.0/2.1 dependency versions to 6.0.0 to reduce minimum requirements for consumers. + 11.0.0 + Adds a .NET 11 target. Updates every dependency to its newest version for each target. No API or behavior changes. MIT true true @@ -32,12 +32,10 @@ README.md IDE0130;IDE0301;IDE0303;IDE0304;IDE0079; + + $(NoWarn);CA1724 - - - - True @@ -49,14 +47,14 @@ - + - - + + - + From 8d9a0b7159a45d5124e3054c1676515c258f54e4 Mon Sep 17 00:00:00 2001 From: electricessence <5899455+electricessence@users.noreply.github.com> Date: Sat, 5 Dec 2026 17:28:45 -0800 Subject: [PATCH 3/8] Move tests to net11.0 and xunit.v3; drop FluentAssertions - Tests, comparison app and benchmarks target net11.0. - xunit 2 -> xunit.v3 4.0.4; Microsoft.NET.Test.Sdk, runner and coverlet updated. - FluentAssertions removed (licensing); its 11 assertions become xunit Assert equivalents. - xUnit1051 silenced: the tests call the token-less overloads on purpose; the library takes a different path when a token can be cancelled. - Comparison app keeps its own Main (XunitAutoGeneratedEntryPoint=false). - BenchmarkDotNet 0.15.8 (build only; no benchmarks run). Co-Authored-By: Claude Opus 5.5 --- .../Open.ChannelExtensions.Benchmarks.csproj | 4 ++-- ...Open.ChannelExtensions.ComparisonTests.csproj | 4 +++- Open.ChannelExtensions.Tests/BasicTests.cs | 16 ++++++++-------- Open.ChannelExtensions.Tests/BatchTests.cs | 6 +++--- .../Open.ChannelExtensions.Tests.csproj | 15 ++++++++------- Open.ChannelExtensions.Tests/_Global.cs | 1 - 6 files changed, 24 insertions(+), 22 deletions(-) diff --git a/Open.ChannelExtensions.Benchmarks/Open.ChannelExtensions.Benchmarks.csproj b/Open.ChannelExtensions.Benchmarks/Open.ChannelExtensions.Benchmarks.csproj index 05eeb33..c6b3d4c 100644 --- a/Open.ChannelExtensions.Benchmarks/Open.ChannelExtensions.Benchmarks.csproj +++ b/Open.ChannelExtensions.Benchmarks/Open.ChannelExtensions.Benchmarks.csproj @@ -2,13 +2,13 @@ Exe - net9.0 + net11.0 enable enable - + diff --git a/Open.ChannelExtensions.ComparisonTests/Open.ChannelExtensions.ComparisonTests.csproj b/Open.ChannelExtensions.ComparisonTests/Open.ChannelExtensions.ComparisonTests.csproj index ff4eac7..9679ad8 100644 --- a/Open.ChannelExtensions.ComparisonTests/Open.ChannelExtensions.ComparisonTests.csproj +++ b/Open.ChannelExtensions.ComparisonTests/Open.ChannelExtensions.ComparisonTests.csproj @@ -2,7 +2,9 @@ Exe - net9.0 + net11.0 + + false diff --git a/Open.ChannelExtensions.Tests/BasicTests.cs b/Open.ChannelExtensions.Tests/BasicTests.cs index cda4eb0..9c5717d 100644 --- a/Open.ChannelExtensions.Tests/BasicTests.cs +++ b/Open.ChannelExtensions.Tests/BasicTests.cs @@ -482,10 +482,10 @@ public static async Task PipeFilterTest() List even = await evenFilter; List odd = await oddFilter; - even.Count.Should().Be(each); - odd.Count.Should().Be(each); - even.Should().OnlyContain(e => e % 2 == 0); - odd.Should().OnlyContain(e => e % 2 != 0); + Assert.Equal(each, even.Count); + Assert.Equal(each, odd.Count); + Assert.All(even, e => Assert.True(e % 2 == 0)); + Assert.All(odd, e => Assert.True(e % 2 != 0)); } [Fact] @@ -510,10 +510,10 @@ public static async Task PipeFilterAsyncTest() List even = await evenFilter; List odd = await oddFilter; - even.Count.Should().Be(each); - odd.Count.Should().Be(each); - even.Should().OnlyContain(e => e % 2 == 0); - odd.Should().OnlyContain(e => e % 2 != 0); + Assert.Equal(each, even.Count); + Assert.Equal(each, odd.Count); + Assert.All(even, e => Assert.True(e % 2 == 0)); + Assert.All(odd, e => Assert.True(e % 2 != 0)); } [Fact] diff --git a/Open.ChannelExtensions.Tests/BatchTests.cs b/Open.ChannelExtensions.Tests/BatchTests.cs index 68505c8..e051c7c 100644 --- a/Open.ChannelExtensions.Tests/BatchTests.cs +++ b/Open.ChannelExtensions.Tests/BatchTests.cs @@ -476,8 +476,8 @@ public static async Task AnotherComplexBatchJoinScenario() }, cancellationToken); - remaining.Should().Be(0); - channel.Reader.TryRead(out _).Should().BeFalse(); - count.Should().Be(SIZE); + Assert.Equal(0, remaining); + Assert.False(channel.Reader.TryRead(out _)); + Assert.Equal(SIZE, count); } } diff --git a/Open.ChannelExtensions.Tests/Open.ChannelExtensions.Tests.csproj b/Open.ChannelExtensions.Tests/Open.ChannelExtensions.Tests.csproj index 2ba2be2..331905a 100644 --- a/Open.ChannelExtensions.Tests/Open.ChannelExtensions.Tests.csproj +++ b/Open.ChannelExtensions.Tests/Open.ChannelExtensions.Tests.csproj @@ -1,10 +1,12 @@ - + Exe - net9.0 + net11.0 latest false + + $(NoWarn);xUnit1051 @@ -12,14 +14,13 @@ - - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Open.ChannelExtensions.Tests/_Global.cs b/Open.ChannelExtensions.Tests/_Global.cs index 168d673..6765a80 100644 --- a/Open.ChannelExtensions.Tests/_Global.cs +++ b/Open.ChannelExtensions.Tests/_Global.cs @@ -1,4 +1,3 @@ -global using FluentAssertions; global using System; global using System.Collections.Generic; global using System.Diagnostics; From e57a500a7cb3c4d5ed622cc4051931f760c09184 Mon Sep 17 00:00:00 2001 From: electricessence <5899455+electricessence@users.noreply.github.com> Date: Sat, 5 Dec 2026 17:28:45 -0800 Subject: [PATCH 4/8] Accept either cancellation exception type in CancellationPropagationConcurrent Under load a reader can start after the token is cancelled, and the result is TaskCanceledException (a subclass of OperationCanceledException). The exact-type check failed 1 of 4 full runs on net11.0. Test-only change. Co-Authored-By: Claude Opus 5.5 --- Open.ChannelExtensions.Tests/CancellationTests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Open.ChannelExtensions.Tests/CancellationTests.cs b/Open.ChannelExtensions.Tests/CancellationTests.cs index 976ad1f..91977ab 100644 --- a/Open.ChannelExtensions.Tests/CancellationTests.cs +++ b/Open.ChannelExtensions.Tests/CancellationTests.cs @@ -91,7 +91,8 @@ await range } catch (Exception ex) { - Assert.IsType(ex); + // Cancellation can surface as OperationCanceledException or its subclass TaskCanceledException, depending on timing. + Assert.IsAssignableFrom(ex); } Assert.Equal(1, count); From 463e680616c66a7fb0cdeb8bfe60075dade8d07e Mon Sep 17 00:00:00 2001 From: electricessence <5899455+electricessence@users.noreply.github.com> Date: Sat, 5 Dec 2026 17:28:45 -0800 Subject: [PATCH 5/8] Add tests workflow: net11.0 tests, full build with warnings as errors, vulnerable packages Co-Authored-By: Claude Opus 5.5 --- .github/workflows/tests.yml | 117 ++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..9784d3a --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,117 @@ +name: Tests + +# Runs the test suite on every pull request and every push to master, and checks the packages for known vulnerabilities. +# The suite runs on net11.0 in Release and in Debug (Debug.Assert is live there). +# The library also builds for netstandard2.0, netstandard2.1, net6.0, net8.0, net9.0 and net10.0; the build job compiles every target. + +on: + push: + branches: [master] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +# One group per ref: a pull request's ref (refs/pull/N/merge) never equals master's, so a pull request run can never cancel a master run. +# A newer push to a pull request cancels the older run; master and manual runs queue and are never cancelled. +concurrency: + group: tests-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +env: + DOTNET_NOLOGO: true + DOTNET_CLI_TELEMETRY_OPTOUT: true + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + +jobs: + test: + name: Test ${{ matrix.name }} + runs-on: windows-latest + timeout-minutes: 30 + defaults: + run: + shell: pwsh + strategy: + fail-fast: false + matrix: + include: + - name: net11.0-Release + configuration: Release + - name: net11.0-Debug + configuration: Debug + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-dotnet@v6 + with: + dotnet-version: 11.0.x + + - name: Run the tests (${{ matrix.name }}) + # global.json opts dotnet test into the Microsoft Testing Platform, which xunit.v3 runs on. + run: dotnet test --project Open.ChannelExtensions.Tests -c ${{ matrix.configuration }} -p:GeneratePackageOnBuild=false --report-xunit-trx --results-directory TestResults/${{ matrix.name }} + + - name: Upload the TRX files + if: always() + uses: actions/upload-artifact@v7 + with: + name: trx-${{ matrix.name }} + path: TestResults/${{ matrix.name }}/*.trx + + build: + name: Build every project and target + runs-on: windows-latest + timeout-minutes: 20 + defaults: + run: + shell: pwsh + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-dotnet@v6 + with: + dotnet-version: 11.0.x + + # Builds the library for all of its target frameworks, plus the tests, the comparison app and the benchmarks. + # Only the build runs here: no benchmark is run. Any warning fails the run. + - name: Build the solution (Release, warnings as errors) + run: dotnet build Open.ChannelExtensions.sln -c Release -warnaserror + + vulnerable-packages: + name: Vulnerable packages + runs-on: windows-latest + timeout-minutes: 15 + defaults: + run: + shell: pwsh + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-dotnet@v6 + with: + dotnet-version: 11.0.x + + # `dotnet list package --vulnerable` exits 0 even when it finds something, so read what it prints. + - name: List vulnerable packages (any finding fails the run) + run: | + $projects = @(Get-ChildItem -Recurse -Filter *.csproj) + $failures = @() + foreach ($project in $projects) { + $output = (dotnet list $project.FullName package --vulnerable --include-transitive 2>&1 | Out-String) + $exitCode = $LASTEXITCODE + Write-Host $output + if ($exitCode -ne 0) { + $failures += "$($project.Name): dotnet list exited with code $exitCode" + } + elseif ($output -match 'has the following vulnerable packages') { + $failures += "$($project.Name): vulnerable packages found (listed above)" + } + elseif ($output -match 'NU1900') { + $failures += "$($project.Name): the vulnerability data could not be read, so the check proved nothing" + } + } + if ($failures.Count -gt 0) { + foreach ($failure in $failures) { Write-Host "::error title=Vulnerable packages::$failure" } + exit 1 + } + "No vulnerable packages in $($projects.Count) project(s)." From 1e0989b29b5f64f7e66ce8aba83e9502a4a2066f Mon Sep 17 00:00:00 2001 From: electricessence <5899455+electricessence@users.noreply.github.com> Date: Sat, 5 Dec 2026 17:31:42 -0800 Subject: [PATCH 6/8] Lock the public API with package validation against 10.0.0 Strict mode, so additions count too. CompatibilitySuppressions.xml lists the two known differences between targets inside the package (netstandard2.0-only ReadAllAsync polyfill; SyncLock is Lock on net9.0+). Release notes now say .NET Standard consumers get the 11.0.0 System packages. Co-Authored-By: Claude Opus 5.5 --- .../CompatibilitySuppressions.xml | 16 ++++++++++++++++ .../Open.ChannelExtensions.csproj | 6 +++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 Open.ChannelExtensions/CompatibilitySuppressions.xml diff --git a/Open.ChannelExtensions/CompatibilitySuppressions.xml b/Open.ChannelExtensions/CompatibilitySuppressions.xml new file mode 100644 index 0000000..7c92979 --- /dev/null +++ b/Open.ChannelExtensions/CompatibilitySuppressions.xml @@ -0,0 +1,16 @@ + + + + + CP0002 + F:Open.ChannelExtensions.BufferingChannelReader`2.SyncLock + lib/net8.0/Open.ChannelExtensions.dll + lib/net9.0/Open.ChannelExtensions.dll + + + CP0002 + M:Open.ChannelExtensions.Extensions.ReadAllAsync``1(System.Threading.Channels.ChannelReader{``0},System.Threading.CancellationToken) + lib/netstandard2.0/Open.ChannelExtensions.dll + lib/netstandard2.1/Open.ChannelExtensions.dll + + \ No newline at end of file diff --git a/Open.ChannelExtensions/Open.ChannelExtensions.csproj b/Open.ChannelExtensions/Open.ChannelExtensions.csproj index c11f747..bc4afa8 100644 --- a/Open.ChannelExtensions/Open.ChannelExtensions.csproj +++ b/Open.ChannelExtensions/Open.ChannelExtensions.csproj @@ -23,7 +23,7 @@ true true 11.0.0 - Adds a .NET 11 target. Updates every dependency to its newest version for each target. No API or behavior changes. + Adds a .NET 11 target. Updates every dependency to its newest version; .NET Standard consumers (including .NET Framework) now get the 11.0.0 System packages. No API or behavior changes. MIT true true @@ -34,6 +34,10 @@ IDE0130;IDE0301;IDE0303;IDE0304;IDE0079; $(NoWarn);CA1724 + + true + 10.0.0 + true From a95b824dd0cf957c4345be011988793c007e1c5d Mon Sep 17 00:00:00 2001 From: electricessence <5899455+electricessence@users.noreply.github.com> Date: Sat, 5 Dec 2026 17:31:43 -0800 Subject: [PATCH 7/8] Fail the test job when no TRX file is produced Co-Authored-By: Claude Opus 5.5 --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9784d3a..53c6f80 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -57,6 +57,7 @@ jobs: with: name: trx-${{ matrix.name }} path: TestResults/${{ matrix.name }}/*.trx + if-no-files-found: error build: name: Build every project and target From 24d80eb07413e1ebf05b73d97ba580ade5677cb6 Mon Sep 17 00:00:00 2001 From: electricessence <5899455+electricessence@users.noreply.github.com> Date: Sat, 5 Dec 2026 20:11:06 -0800 Subject: [PATCH 8/8] Remove the test jobs from CI, at the owner's request The timing-sensitive channel tests fail on small hosted runners (4 cores), and they fail on master too when the cores are limited. The owner runs the full suite locally before each release instead. The workflow becomes build.yml: it still builds every project and target with warnings as errors (which packs and runs the API check), and still fails on any vulnerable package. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/{tests.yml => build.yml} | 45 +++------------------- 1 file changed, 6 insertions(+), 39 deletions(-) rename .github/workflows/{tests.yml => build.yml} (65%) diff --git a/.github/workflows/tests.yml b/.github/workflows/build.yml similarity index 65% rename from .github/workflows/tests.yml rename to .github/workflows/build.yml index 53c6f80..e85194e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,9 @@ -name: Tests +name: Build -# Runs the test suite on every pull request and every push to master, and checks the packages for known vulnerabilities. -# The suite runs on net11.0 in Release and in Debug (Debug.Assert is live there). -# The library also builds for netstandard2.0, netstandard2.1, net6.0, net8.0, net9.0 and net10.0; the build job compiles every target. +# Builds every project and target, and checks the packages for known vulnerabilities, on every pull request and every push to master. +# The library builds for netstandard2.0, netstandard2.1, net6.0, net8.0, net9.0, net10.0 and net11.0. +# The test suite does not run here. Its timing-sensitive channel tests fail on small hosted runners (they fail on master too), +# so the owner runs the full suite locally before every release. on: push: @@ -16,7 +17,7 @@ permissions: # One group per ref: a pull request's ref (refs/pull/N/merge) never equals master's, so a pull request run can never cancel a master run. # A newer push to a pull request cancels the older run; master and manual runs queue and are never cancelled. concurrency: - group: tests-${{ github.ref }} + group: build-${{ github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} env: @@ -25,40 +26,6 @@ env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true jobs: - test: - name: Test ${{ matrix.name }} - runs-on: windows-latest - timeout-minutes: 30 - defaults: - run: - shell: pwsh - strategy: - fail-fast: false - matrix: - include: - - name: net11.0-Release - configuration: Release - - name: net11.0-Debug - configuration: Debug - steps: - - uses: actions/checkout@v7 - - - uses: actions/setup-dotnet@v6 - with: - dotnet-version: 11.0.x - - - name: Run the tests (${{ matrix.name }}) - # global.json opts dotnet test into the Microsoft Testing Platform, which xunit.v3 runs on. - run: dotnet test --project Open.ChannelExtensions.Tests -c ${{ matrix.configuration }} -p:GeneratePackageOnBuild=false --report-xunit-trx --results-directory TestResults/${{ matrix.name }} - - - name: Upload the TRX files - if: always() - uses: actions/upload-artifact@v7 - with: - name: trx-${{ matrix.name }} - path: TestResults/${{ matrix.name }}/*.trx - if-no-files-found: error - build: name: Build every project and target runs-on: windows-latest