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

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).
@vbreussvbreuss self-assigned this Jul 31, 2026
@vbreussvbreuss 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 mainJul 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

EventMeanErrorStdDevRatioAllocatedAlloc Ratio
baseline*326.2 ns9.80 ns9.17 ns1.381.7 KB1.00
Mockolate235.7 ns9.67 ns9.05 ns1.001.7 KB1.00
Imposter1,031.2 ns18.44 ns17.25 ns4.388.8 KB5.17
TUnitMocks136.4 ns1.57 ns1.47 ns0.581.34 KB0.79
Moq11,219.0 ns110.64 ns103.49 ns47.6712.51 KB7.34
NSubstitute3,917.3 ns61.04 ns57.10 ns16.649.05 KB5.31
FakeItEasy184,266.7 ns463.75 ns387.25 ns782.9015.26 KB8.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

IndexerNMeanErrorStdDevRatioAllocatedAlloc Ratio
baseline*1997.5 ns39.12 ns36.60 ns1.063.77 KB1.00
Mockolate1943.7 ns41.38 ns36.68 ns1.003.77 KB1.00
Imposter1812.1 ns24.33 ns21.56 ns0.865.16 KB1.37
Moq197,675.0 ns1,582.52 ns1,480.29 ns103.6420.37 KB5.41
NSubstitute18,810.4 ns72.62 ns64.38 ns9.3512.78 KB3.39
FakeItEasy17,746.4 ns182.26 ns170.48 ns8.2213.62 KB3.62
baseline*102,526.2 ns45.31 ns42.38 ns0.964.82 KB1.00
Mockolate102,631.7 ns41.60 ns38.91 ns1.004.82 KB1.00
Imposter102,045.4 ns33.97 ns31.78 ns0.787.97 KB1.65
Moq10105,550.4 ns1,367.18 ns1,278.86 ns40.1228.74 KB5.96
NSubstitute1020,033.1 ns185.31 ns164.27 ns7.6125.58 KB5.31
FakeItEasy1018,829.5 ns310.62 ns290.56 ns7.1632.98 KB6.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

PropertyNMeanErrorStdDevRatioAllocatedAlloc Ratio
baseline*1566.3 ns20.57 ns19.25 ns1.102.41 KB1.00
Mockolate1516.4 ns29.91 ns27.98 ns1.002.41 KB1.00
Imposter1434.3 ns6.19 ns5.49 ns0.843.13 KB1.29
TUnitMocks1454.0 ns7.12 ns6.66 ns0.881.64 KB0.68
Moq111,337.1 ns70.56 ns66.00 ns22.0110.39 KB4.30
NSubstitute17,317.5 ns42.66 ns37.81 ns14.2111.45 KB4.74
FakeItEasy18,170.7 ns44.55 ns34.79 ns15.8711.24 KB4.66
baseline*101,078.5 ns22.33 ns20.89 ns1.072.91 KB1.00
Mockolate101,012.2 ns13.27 ns11.08 ns1.002.91 KB1.00
Imposter101,102.5 ns7.15 ns5.97 ns1.094.67 KB1.61
TUnitMocks101,577.9 ns18.22 ns16.15 ns1.563.94 KB1.35
Moq1018,382.3 ns117.97 ns104.57 ns18.1618.28 KB6.29
NSubstitute1016,413.7 ns85.57 ns75.86 ns16.2221.08 KB7.25
FakeItEasy1019,761.8 ns212.91 ns199.16 ns19.5230.81 KB10.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

CreateMockMeanErrorStdDevRatioAllocatedAlloc Ratio
baseline*18.24 ns0.224 ns0.199 ns1.04160 B1.00
Mockolate17.48 ns0.484 ns0.453 ns1.00160 B1.00
Imposter285.32 ns12.564 ns11.753 ns16.332248 B14.05
TUnitMocks35.59 ns0.565 ns0.529 ns2.04200 B1.25
Moq1,454.30 ns8.327 ns7.789 ns83.232096 B13.10
NSubstitute2,007.21 ns27.415 ns25.644 ns114.885048 B31.55
FakeItEasy1,835.04 ns17.483 ns16.354 ns105.022763 B17.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

CallbackMeanErrorStdDevRatioAllocatedAlloc Ratio
baseline*318.1 ns5.63 ns4.99 ns0.971.57 KB1.00
Mockolate327.3 ns4.56 ns3.81 ns1.001.57 KB1.00
Imposter454.8 ns8.73 ns7.74 ns1.392.38 KB1.52
TUnitMocks511.1 ns8.86 ns8.29 ns1.561.99 KB1.27
Moq99,053.2 ns352.08 ns294.01 ns302.708.96 KB5.71
NSubstitute4,765.7 ns31.35 ns26.18 ns14.567.71 KB4.91
FakeItEasy5,067.6 ns46.42 ns43.42 ns15.496.81 KB4.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

MethodNMeanErrorStdDevRatioAllocatedAlloc Ratio
baseline*1356.9 ns16.05 ns15.02 ns0.911.93 KB1.00
Mockolate1392.5 ns8.27 ns7.33 ns1.001.93 KB1.00
Imposter1566.0 ns4.97 ns4.15 ns1.444.04 KB2.09
TUnitMocks1503.8 ns5.78 ns5.41 ns1.282.02 KB1.04
Moq1136,626.3 ns737.78 ns616.08 ns348.2414.74 KB7.64
NSubstitute15,589.2 ns80.09 ns71.00 ns14.259.06 KB4.70
FakeItEasy15,645.7 ns56.29 ns52.66 ns14.398.05 KB4.17
baseline*10674.7 ns7.95 ns7.04 ns1.022.14 KB1.00
Mockolate10661.7 ns10.33 ns9.66 ns1.002.14 KB1.00
Imposter101,120.9 ns12.38 ns11.58 ns1.695.52 KB2.58
TUnitMocks101,426.6 ns13.34 ns11.83 ns2.163.73 KB1.74
Moq10139,216.2 ns253.32 ns224.56 ns210.4218.64 KB8.71
NSubstitute108,126.8 ns147.04 ns137.54 ns12.2811.52 KB5.38
FakeItEasy108,490.0 ns60.32 ns53.47 ns12.8315.42 KB7.20

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

github-actionsBot added a commit that referenced this pull request Jul 31, 2026
github-actionsBot added a commit that referenced this pull request Jul 31, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coverageAdditional tests for edge cases or improvement of test coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@vbreuss