Skip to content

test: pin pending-task returns and abstract-indexer generation - #833

Merged
vbreuss merged 1 commit into
mainfrom
tests/pending-task-and-abstract-indexer-regression
Jul 31, 2026
Merged

test: pin pending-task returns and abstract-indexer generation#833
vbreuss merged 1 commit into
mainfrom
tests/pending-task-and-abstract-indexer-regression

Conversation

@vbreuss

@vbreuss vbreuss commented Jul 31, 2026

Copy link
Copy Markdown
Member

Add two regression tests prompted by TUnit issues #6515 and #6516:

  • Returns(() => tcs.Task) must hand the pending task to the caller as-is, so it can be raced against timeouts or cancellation.
  • Mocking an abstract class with abstract indexers must not emit base[...] calls (would be CS0205).

Add two regression tests prompted by TUnit issues #6515 and #6516:
- Returns(() => tcs.Task) must hand the pending task to the caller as-is, so it can be raced against timeouts or cancellation.
- Mocking an abstract class with abstract indexers must not emit base[...] calls (would be CS0205).
@vbreuss vbreuss self-assigned this Jul 31, 2026
@vbreuss vbreuss added the coverage Additional tests for edge cases or improvement of test coverage label Jul 31, 2026
@vbreuss
vbreuss enabled auto-merge (squash) July 31, 2026 06:09
@vbreuss
vbreuss disabled auto-merge July 31, 2026 06:09
@vbreuss
vbreuss enabled auto-merge (squash) July 31, 2026 06:09
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

Test Results

    24 files  ± 0      24 suites  ±0   11m 24s ⏱️ -21s
 4 320 tests + 2   4 318 ✅ + 2  2 💤 ±0  0 ❌ ±0 
27 568 runs  +10  27 564 ✅ +10  4 💤 ±0  0 ❌ ±0 

Results for commit c6b6636. ± Comparison against base commit e7d8f71.

@vbreuss
vbreuss merged commit 969467e into main Jul 31, 2026
17 checks passed
@vbreuss
vbreuss deleted the tests/pending-task-and-abstract-indexer-regression branch July 31, 2026 06:16
@github-actions

Copy link
Copy Markdown

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.60GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.302
[Host] : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v4

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Event Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 326.2 ns 9.80 ns 9.17 ns 1.38 1.7 KB 1.00
Mockolate 235.7 ns 9.67 ns 9.05 ns 1.00 1.7 KB 1.00
Imposter 1,031.2 ns 18.44 ns 17.25 ns 4.38 8.8 KB 5.17
TUnitMocks 136.4 ns 1.57 ns 1.47 ns 0.58 1.34 KB 0.79
Moq 11,219.0 ns 110.64 ns 103.49 ns 47.67 12.51 KB 7.34
NSubstitute 3,917.3 ns 61.04 ns 57.10 ns 16.64 9.05 KB 5.31
FakeItEasy 184,266.7 ns 463.75 ns 387.25 ns 782.90 15.26 KB 8.96
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
INTEL XEON PLATINUM 8573C 3.47GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.302
[Host] : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v4

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Indexer N Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 1 997.5 ns 39.12 ns 36.60 ns 1.06 3.77 KB 1.00
Mockolate 1 943.7 ns 41.38 ns 36.68 ns 1.00 3.77 KB 1.00
Imposter 1 812.1 ns 24.33 ns 21.56 ns 0.86 5.16 KB 1.37
Moq 1 97,675.0 ns 1,582.52 ns 1,480.29 ns 103.64 20.37 KB 5.41
NSubstitute 1 8,810.4 ns 72.62 ns 64.38 ns 9.35 12.78 KB 3.39
FakeItEasy 1 7,746.4 ns 182.26 ns 170.48 ns 8.22 13.62 KB 3.62
baseline* 10 2,526.2 ns 45.31 ns 42.38 ns 0.96 4.82 KB 1.00
Mockolate 10 2,631.7 ns 41.60 ns 38.91 ns 1.00 4.82 KB 1.00
Imposter 10 2,045.4 ns 33.97 ns 31.78 ns 0.78 7.97 KB 1.65
Moq 10 105,550.4 ns 1,367.18 ns 1,278.86 ns 40.12 28.74 KB 5.96
NSubstitute 10 20,033.1 ns 185.31 ns 164.27 ns 7.61 25.58 KB 5.31
FakeItEasy 10 18,829.5 ns 310.62 ns 290.56 ns 7.16 32.98 KB 6.84
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 2.45GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.302
[Host] : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Property N Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 1 566.3 ns 20.57 ns 19.25 ns 1.10 2.41 KB 1.00
Mockolate 1 516.4 ns 29.91 ns 27.98 ns 1.00 2.41 KB 1.00
Imposter 1 434.3 ns 6.19 ns 5.49 ns 0.84 3.13 KB 1.29
TUnitMocks 1 454.0 ns 7.12 ns 6.66 ns 0.88 1.64 KB 0.68
Moq 1 11,337.1 ns 70.56 ns 66.00 ns 22.01 10.39 KB 4.30
NSubstitute 1 7,317.5 ns 42.66 ns 37.81 ns 14.21 11.45 KB 4.74
FakeItEasy 1 8,170.7 ns 44.55 ns 34.79 ns 15.87 11.24 KB 4.66
baseline* 10 1,078.5 ns 22.33 ns 20.89 ns 1.07 2.91 KB 1.00
Mockolate 10 1,012.2 ns 13.27 ns 11.08 ns 1.00 2.91 KB 1.00
Imposter 10 1,102.5 ns 7.15 ns 5.97 ns 1.09 4.67 KB 1.61
TUnitMocks 10 1,577.9 ns 18.22 ns 16.15 ns 1.56 3.94 KB 1.35
Moq 10 18,382.3 ns 117.97 ns 104.57 ns 18.16 18.28 KB 6.29
NSubstitute 10 16,413.7 ns 85.57 ns 75.86 ns 16.22 21.08 KB 7.25
FakeItEasy 10 19,761.8 ns 212.91 ns 199.16 ns 19.52 30.81 KB 10.60
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 2.45GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.302
[Host] : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

CreateMock Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 18.24 ns 0.224 ns 0.199 ns 1.04 160 B 1.00
Mockolate 17.48 ns 0.484 ns 0.453 ns 1.00 160 B 1.00
Imposter 285.32 ns 12.564 ns 11.753 ns 16.33 2248 B 14.05
TUnitMocks 35.59 ns 0.565 ns 0.529 ns 2.04 200 B 1.25
Moq 1,454.30 ns 8.327 ns 7.789 ns 83.23 2096 B 13.10
NSubstitute 2,007.21 ns 27.415 ns 25.644 ns 114.88 5048 B 31.55
FakeItEasy 1,835.04 ns 17.483 ns 16.354 ns 105.02 2763 B 17.27
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 3.13GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.302
[Host] : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Callback Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 318.1 ns 5.63 ns 4.99 ns 0.97 1.57 KB 1.00
Mockolate 327.3 ns 4.56 ns 3.81 ns 1.00 1.57 KB 1.00
Imposter 454.8 ns 8.73 ns 7.74 ns 1.39 2.38 KB 1.52
TUnitMocks 511.1 ns 8.86 ns 8.29 ns 1.56 1.99 KB 1.27
Moq 99,053.2 ns 352.08 ns 294.01 ns 302.70 8.96 KB 5.71
NSubstitute 4,765.7 ns 31.35 ns 26.18 ns 14.56 7.71 KB 4.91
FakeItEasy 5,067.6 ns 46.42 ns 43.42 ns 15.49 6.81 KB 4.33
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.60GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.302
[Host] : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Method N Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 1 356.9 ns 16.05 ns 15.02 ns 0.91 1.93 KB 1.00
Mockolate 1 392.5 ns 8.27 ns 7.33 ns 1.00 1.93 KB 1.00
Imposter 1 566.0 ns 4.97 ns 4.15 ns 1.44 4.04 KB 2.09
TUnitMocks 1 503.8 ns 5.78 ns 5.41 ns 1.28 2.02 KB 1.04
Moq 1 136,626.3 ns 737.78 ns 616.08 ns 348.24 14.74 KB 7.64
NSubstitute 1 5,589.2 ns 80.09 ns 71.00 ns 14.25 9.06 KB 4.70
FakeItEasy 1 5,645.7 ns 56.29 ns 52.66 ns 14.39 8.05 KB 4.17
baseline* 10 674.7 ns 7.95 ns 7.04 ns 1.02 2.14 KB 1.00
Mockolate 10 661.7 ns 10.33 ns 9.66 ns 1.00 2.14 KB 1.00
Imposter 10 1,120.9 ns 12.38 ns 11.58 ns 1.69 5.52 KB 2.58
TUnitMocks 10 1,426.6 ns 13.34 ns 11.83 ns 2.16 3.73 KB 1.74
Moq 10 139,216.2 ns 253.32 ns 224.56 ns 210.42 18.64 KB 8.71
NSubstitute 10 8,126.8 ns 147.04 ns 137.54 ns 12.28 11.52 KB 5.38
FakeItEasy 10 8,490.0 ns 60.32 ns 53.47 ns 12.83 15.42 KB 7.20

baseline* rows show the corresponding Mockolate benchmark from the most recent successful main branch build with results, for regression comparison.

github-actions Bot added a commit that referenced this pull request Jul 31, 2026
…ract-indexer generation (#833) by Valentin Breuß
github-actions Bot added a commit that referenced this pull request Jul 31, 2026
…ract-indexer generation (#833) by Valentin Breuß
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coverage Additional tests for edge cases or improvement of test coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant