Skip to content

Commit 61b3c56

Browse files
authored
Update SDK to .NET 7, re-enable NativeAOT tests, fix some other tests (#2209)
* update SDK to 7.0 * update samples and test projects to .NET 7 * bump NativeAOT tests to .NET 7, re-enable some of them * handle edge case to get the tests passing again * don't run Full Framework tests on AppVeyor to avoid build timeouts * avoid reflection when possible * NativeAOT is not supported on macOS with .NET 7 * run fewer tests on AppVeyor to avoid getting timeouts
1 parent 7982b8c commit 61b3c56

File tree

26 files changed

+70
-68
lines changed

26 files changed

+70
-68
lines changed

build/Build.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
66
</PropertyGroup>
77
<ItemGroup>

build/Program.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ public class BuildContext : FrostingContext
6363
public DotNetCoreMSBuildSettings MsBuildSettings { get; }
6464

6565
private IAppVeyorProvider AppVeyor => this.BuildSystem().AppVeyor;
66-
public bool IsOnAppVeyorAndNotPr => AppVeyor.IsRunningOnAppVeyor && !AppVeyor.Environment.PullRequest.IsPullRequest;
66+
public bool IsRunningOnAppVeyor => AppVeyor.IsRunningOnAppVeyor;
67+
public bool IsOnAppVeyorAndNotPr => IsRunningOnAppVeyor && !AppVeyor.Environment.PullRequest.IsPullRequest;
6768
public bool IsOnAppVeyorAndBdnNightlyCiCd => IsOnAppVeyorAndNotPr && AppVeyor.Environment.Repository.Branch == "master" && this.IsRunningOnWindows();
6869
public bool IsLocalBuild => this.BuildSystem().IsLocalBuild;
6970
public bool IsCiBuild => !this.BuildSystem().IsLocalBuild;
@@ -338,8 +339,8 @@ public override bool ShouldRun(BuildContext context)
338339
public override void Run(BuildContext context)
339340
{
340341
var targetFrameworks = context.IsRunningOnWindows()
341-
? new[] { "net462", "net6.0" }
342-
: new[] { "net6.0" };
342+
? new[] { "net462", "net7.0" }
343+
: new[] { "net7.0" };
343344

344345
foreach (var targetFramework in targetFrameworks)
345346
context.RunTests(context.UnitTestsProjectFile, "UnitTests", targetFramework);
@@ -352,7 +353,7 @@ public class SlowFullFrameworkTestsTask : FrostingTask<BuildContext>
352353
{
353354
public override bool ShouldRun(BuildContext context)
354355
{
355-
return !context.SkipTests && !context.SkipSlowTests && context.IsRunningOnWindows();
356+
return !context.SkipTests && !context.SkipSlowTests && context.IsRunningOnWindows() && !context.IsRunningOnAppVeyor;
356357
}
357358

358359
public override void Run(BuildContext context)
@@ -361,9 +362,9 @@ public override void Run(BuildContext context)
361362
}
362363
}
363364

364-
[TaskName("SlowTestsNet5")]
365+
[TaskName("SlowTestsNetCore")]
365366
[IsDependentOn(typeof(BuildTask))]
366-
public class SlowTestsNet5Task : FrostingTask<BuildContext>
367+
public class SlowTestsNetCoreTask : FrostingTask<BuildContext>
367368
{
368369
public override bool ShouldRun(BuildContext context)
369370
{
@@ -372,14 +373,14 @@ public override bool ShouldRun(BuildContext context)
372373

373374
public override void Run(BuildContext context)
374375
{
375-
context.RunTests(context.IntegrationTestsProjectFile, "IntegrationTests", "net6.0");
376+
context.RunTests(context.IntegrationTestsProjectFile, "IntegrationTests", "net7.0");
376377
}
377378
}
378379

379380
[TaskName("AllTests")]
380381
[IsDependentOn(typeof(FastTestsTask))]
381382
[IsDependentOn(typeof(SlowFullFrameworkTestsTask))]
382-
[IsDependentOn(typeof(SlowTestsNet5Task))]
383+
[IsDependentOn(typeof(SlowTestsNetCoreTask))]
383384
public class AllTestsTask : FrostingTask<BuildContext>
384385
{
385386
}

build/global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "6.0.201",
3+
"version": "7.0.100",
44
"rollForward": "disable"
55
}
66
}

docs/_redirects/RedirectGenerator/RedirectGenerator.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net7.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>

samples/BenchmarkDotNet.Samples.FSharp/BenchmarkDotNet.Samples.FSharp.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</PropertyGroup>
66
<PropertyGroup>
77
<OutputType>Exe</OutputType>
8-
<TargetFrameworks>net462;net6.0</TargetFrameworks>
8+
<TargetFrameworks>net462;net7.0</TargetFrameworks>
99
</PropertyGroup>
1010
<ItemGroup>
1111
<Compile Include="Program.fs" />

samples/BenchmarkDotNet.Samples/BenchmarkDotNet.Samples.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="..\..\build\common.props" />
33
<PropertyGroup>
44
<AssemblyTitle>BenchmarkDotNet.Samples</AssemblyTitle>
5-
<TargetFrameworks>net462;net6.0</TargetFrameworks>
5+
<TargetFrameworks>net462;net7.0</TargetFrameworks>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
77
<AssemblyName>BenchmarkDotNet.Samples</AssemblyName>
88
<OutputType>Exe</OutputType>

src/BenchmarkDotNet/Engines/GcStats.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ public struct GcStats : IEquatable<GcStats>
1313

1414
public static readonly long AllocationQuantum = CalculateAllocationQuantumSize();
1515

16+
#if !NET6_0_OR_GREATER
1617
private static readonly Func<long> GetAllocatedBytesForCurrentThreadDelegate = CreateGetAllocatedBytesForCurrentThreadDelegate();
1718
private static readonly Func<bool, long> GetTotalAllocatedBytesDelegate = CreateGetTotalAllocatedBytesDelegate();
18-
19+
#endif
1920
public static readonly GcStats Empty = new GcStats(0, 0, 0, 0, 0);
2021

2122
private GcStats(int gen0Collections, int gen1Collections, int gen2Collections, long allocatedBytes, long totalOperations)
@@ -142,11 +143,15 @@ private static long GetAllocatedBytes()
142143
if (RuntimeInformation.IsFullFramework) // it can be a .NET app consuming our .NET Standard package
143144
return AppDomain.CurrentDomain.MonitoringTotalAllocatedMemorySize;
144145

146+
#if NET6_0_OR_GREATER
147+
return GC.GetTotalAllocatedBytes(precise: true);
148+
#else
145149
if (GetTotalAllocatedBytesDelegate != null) // it's .NET Core 3.0 with the new API available
146150
return GetTotalAllocatedBytesDelegate.Invoke(true); // true for the "precise" argument
147151

148152
// https://apisof.net/catalog/System.GC.GetAllocatedBytesForCurrentThread() is not part of the .NET Standard, so we use reflection to call it..
149153
return GetAllocatedBytesForCurrentThreadDelegate.Invoke();
154+
#endif
150155
}
151156

152157
private static Func<long> CreateGetAllocatedBytesForCurrentThreadDelegate()

src/BenchmarkDotNet/Toolchains/Executor.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.ComponentModel;
23
using System.Diagnostics;
34
using System.IO;
45
using System.IO.Pipes;
@@ -67,7 +68,17 @@ private static ExecuteResult Execute(Process process, BenchmarkCase benchmarkCas
6768
{
6869
logger.WriteLineInfo($"// Execute: {process.StartInfo.FileName} {process.StartInfo.Arguments} in {process.StartInfo.WorkingDirectory}");
6970

70-
process.Start();
71+
try
72+
{
73+
process.Start();
74+
}
75+
catch (Win32Exception ex)
76+
{
77+
logger.WriteLineError($"// Failed to start the benchmark process: {ex}");
78+
79+
return new ExecuteResult(true, null, null, Array.Empty<string>(), Array.Empty<string>(), Array.Empty<string>(), launchIndex);
80+
}
81+
7182
processOutputReader.BeginRead();
7283

7384
process.EnsureHighPriority(logger);

tests/BenchmarkDotNet.IntegrationTests.ConfigPerAssembly/BenchmarkDotNet.IntegrationTests.ConfigPerAssembly.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="..\..\build\common.props" />
33
<PropertyGroup>
44
<AssemblyTitle>BenchmarkDotNet.IntegrationTests.ConfigPerAssembly</AssemblyTitle>
5-
<TargetFrameworks>net462;net6.0</TargetFrameworks>
5+
<TargetFrameworks>net462;net7.0</TargetFrameworks>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
77
<AssemblyName>BenchmarkDotNet.IntegrationTests.ConfigPerAssembly</AssemblyName>
88
<PackageId>BenchmarkDotNet.IntegrationTests.ConfigPerAssembly</PackageId>

tests/BenchmarkDotNet.IntegrationTests.DisabledOptimizations/BenchmarkDotNet.IntegrationTests.DisabledOptimizations.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="..\..\build\common.props" />
33
<PropertyGroup>
44
<AssemblyTitle>BenchmarkDotNet.IntegrationTests.DisabledOptimizations</AssemblyTitle>
5-
<TargetFrameworks>net462;net6.0</TargetFrameworks>
5+
<TargetFrameworks>net462;net7.0</TargetFrameworks>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
77
<AssemblyName>BenchmarkDotNet.IntegrationTests.DisabledOptimizations</AssemblyName>
88
<PackageId>BenchmarkDotNet.IntegrationTests.DisabledOptimizations</PackageId>

tests/BenchmarkDotNet.IntegrationTests.EnabledOptimizations/BenchmarkDotNet.IntegrationTests.EnabledOptimizations.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="..\..\build\common.props" />
33
<PropertyGroup>
44
<AssemblyTitle>BenchmarkDotNet.IntegrationTests.EnabledOptimizations</AssemblyTitle>
5-
<TargetFrameworks>net462;net6.0</TargetFrameworks>
5+
<TargetFrameworks>net462;net7.0</TargetFrameworks>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
77
<AssemblyName>BenchmarkDotNet.IntegrationTests.EnabledOptimizations</AssemblyName>
88
<PackageId>BenchmarkDotNet.IntegrationTests.EnabledOptimizations</PackageId>

tests/BenchmarkDotNet.IntegrationTests.FSharp/BenchmarkDotNet.IntegrationTests.FSharp.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</PropertyGroup>
66
<Import Project="..\..\build\common.props" />
77
<PropertyGroup>
8-
<TargetFrameworks>net462;net6.0</TargetFrameworks>
8+
<TargetFrameworks>net462;net7.0</TargetFrameworks>
99
<PublicSign>false</PublicSign>
1010
</PropertyGroup>
1111
<ItemGroup>

tests/BenchmarkDotNet.IntegrationTests.ManualRunning/BenchmarkDotNet.IntegrationTests.ManualRunning.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="..\..\build\common.props" />
33
<PropertyGroup>
44
<AssemblyTitle>BenchmarkDotNet.IntegrationTests.ManualRunning</AssemblyTitle>
5-
<TargetFrameworks>net462;net6.0</TargetFrameworks>
5+
<TargetFrameworks>net462;net7.0</TargetFrameworks>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
77
<AssemblyName>BenchmarkDotNet.IntegrationTests.ManualRunning</AssemblyName>
88
<PackageId>BenchmarkDotNet.IntegrationTests.ManualRunning</PackageId>

tests/BenchmarkDotNet.IntegrationTests.Static/BenchmarkDotNet.IntegrationTests.Static.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="..\..\build\common.props" />
33
<PropertyGroup>
44
<AssemblyTitle>BenchmarkDotNet.IntegrationTests.Static</AssemblyTitle>
5-
<TargetFrameworks>net462;net6.0</TargetFrameworks>
5+
<TargetFrameworks>net462;net7.0</TargetFrameworks>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
77
<AssemblyName>BenchmarkDotNet.IntegrationTests.Static</AssemblyName>
88
<PackageId>BenchmarkDotNet.IntegrationTests.Static</PackageId>

tests/BenchmarkDotNet.IntegrationTests.VisualBasic/BenchmarkDotNet.IntegrationTests.VisualBasic.vbproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</PropertyGroup>
66
<Import Project="..\..\build\common.props" />
77
<PropertyGroup>
8-
<TargetFrameworks>net462;net6.0</TargetFrameworks>
8+
<TargetFrameworks>net462;net7.0</TargetFrameworks>
99
</PropertyGroup>
1010
<ItemGroup>
1111
<ProjectReference Include="..\..\src\BenchmarkDotNet\BenchmarkDotNet.csproj" />

tests/BenchmarkDotNet.IntegrationTests/BenchmarkDotNet.IntegrationTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="..\..\build\common.props" />
33
<PropertyGroup>
44
<AssemblyTitle>BenchmarkDotNet.IntegrationTests</AssemblyTitle>
5-
<TargetFrameworks>net462;net6.0</TargetFrameworks>
5+
<TargetFrameworks>net462;net7.0</TargetFrameworks>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
77
<AssemblyName>BenchmarkDotNet.IntegrationTests</AssemblyName>
88
<PackageId>BenchmarkDotNet.IntegrationTests</PackageId>

tests/BenchmarkDotNet.IntegrationTests/BuildTimeoutTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ public void WhenBuildTakesMoreTimeThanTheTimeoutTheBuildIsCancelled()
1919
{
2020
if (!RuntimeInformation.Is64BitPlatform()) // NativeAOT does not support 32bit yet
2121
return;
22+
if (RuntimeInformation.IsMacOSX())
23+
return; // currently not supported
2224

2325
// we use NativeAOT on purpose because it takes a LOT of time to build it
2426
// so we can be sure that timeout = 1s should fail!
@@ -27,12 +29,10 @@ public void WhenBuildTakesMoreTimeThanTheTimeoutTheBuildIsCancelled()
2729
var config = ManualConfig.CreateEmpty()
2830
.WithBuildTimeout(timeout)
2931
.AddJob(Job.Dry
30-
.WithRuntime(NativeAotRuntime.Net60)
32+
.WithRuntime(NativeAotRuntime.Net70)
3133
.WithToolchain(NativeAotToolchain.CreateBuilder()
32-
.UseNuGet(
33-
"6.0.0-rc.1.21420.1", // we test against specific version to keep this test stable
34-
"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json") // using old feed that supports net6.0
35-
.TargetFrameworkMoniker("net6.0")
34+
.UseNuGet("7.0.0", "https://api.nuget.org/v3/index.json")
35+
.TargetFrameworkMoniker("net7.0")
3636
.ToToolchain()));
3737

3838
var summary = CanExecute<NativeAotBenchmark>(config, fullValidation: false);

tests/BenchmarkDotNet.IntegrationTests/DisassemblyDiagnoserTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static IEnumerable<object[]> GetAllJits()
3333

3434
new object[] { Jit.RyuJit, Platform.X64, ClrRuntime.Net462 }, // RyuJit for desktop .NET
3535
#endif
36-
new object[] { Jit.RyuJit, Platform.X64, CoreRuntime.Core60 }, // .NET Core
36+
new object[] { Jit.RyuJit, Platform.X64, CoreRuntime.Core70 }, // .NET Core
3737

3838
// we could add new object[] { Jit.Llvm, Platform.X64, new MonoRuntime() } here but our CI would need to have Mono installed..
3939
};

tests/BenchmarkDotNet.IntegrationTests/JitRuntimeValidationTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void CheckClrOnWindows(Jit jit, Platform platform, string errorMessage)
4545
[InlineData(Jit.RyuJit, Platform.X64, null)]
4646
public void CheckCore(Jit jit, Platform platform, string errorMessage)
4747
{
48-
Verify(CoreRuntime.Core60, jit, platform, errorMessage);
48+
Verify(CoreRuntime.Core70, jit, platform, errorMessage);
4949
}
5050

5151
private void Verify(Runtime runtime, Jit jit, Platform platform, string errorMessage)

tests/BenchmarkDotNet.IntegrationTests/LargeAddressAwareTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ public void BenchmarkCanAllocateMoreThan2Gb()
2525
var summary = BenchmarkRunner
2626
.Run<NeedsMoreThan2GB>(
2727
ManualConfig.CreateEmpty()
28-
.AddJob(Job.Dry.WithRuntime(CoreRuntime.Core60).WithPlatform(Platform.X64).WithId("Core"))
29-
.AddJob(Job.Dry.WithRuntime(ClrRuntime.Net462).WithPlatform(Platform.X86).WithLargeAddressAware().WithId("Framework"))
28+
.AddJob(Job.Dry.WithRuntime(CoreRuntime.Core70).WithPlatform(Platform.X64).WithId("Core"))
29+
.AddJob(Job.Dry.WithRuntime(ClrRuntime.Net462).WithPlatform(Platform.X86).WithGcServer(false).WithLargeAddressAware().WithId("Framework"))
3030
.AddColumnProvider(DefaultColumnProviders.Instance)
3131
.AddLogger(new OutputLogger(output)));
3232

@@ -47,7 +47,7 @@ public void BenchmarkCanAllocateMoreThan2Gb()
4747
.Any());
4848

4949
Assert.Contains(".NET Framework", summary.AllRuntimes);
50-
Assert.Contains(".NET 6.0", summary.AllRuntimes);
50+
Assert.Contains(".NET 7.0", summary.AllRuntimes);
5151
}
5252
}
5353

tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,21 @@ public void MemoryDiagnoserIsAccurate(IToolchain toolchain)
6060
{
6161
{ nameof(AccurateAllocations.EightBytesArray), 8 + objectAllocationOverhead + arraySizeOverhead },
6262
{ nameof(AccurateAllocations.SixtyFourBytesArray), 64 + objectAllocationOverhead + arraySizeOverhead },
63-
6463
{ nameof(AccurateAllocations.AllocateTask), CalculateRequiredSpace<Task<int>>() },
6564
});
6665
}
6766

68-
[FactDotNetCoreOnly("We don't want to test NativeAOT twice (for .NET Framework 4.6.2 and .NET 6.0)")]
67+
[FactDotNetCoreOnly("We don't want to test NativeAOT twice (for .NET Framework 4.6.2 and .NET 7.0)")]
6968
public void MemoryDiagnoserSupportsNativeAOT()
7069
{
71-
if (ContinuousIntegration.IsAppVeyorOnWindows()) // too time consuming for AppVeyor (1h limit)
72-
return;
73-
if (RuntimeInformation.GetCurrentPlatform() == Platform.Arm64 && RuntimeInformation.IsMacOSX())
74-
return; // Native compilation does not support targeting osx-arm64 yet. https://github.com/dotnet/corert/issues/4589
70+
if (RuntimeInformation.IsMacOSX())
71+
return; // currently not supported
72+
if (ContinuousIntegration.IsAppVeyorOnWindows())
73+
return; // timeouts
7574

7675
MemoryDiagnoserIsAccurate(
7776
NativeAotToolchain.CreateBuilder()
78-
.UseNuGet(
79-
"6.0.0-rc.1.21420.1", // we test against specific version to keep this test stable
80-
"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json")
77+
.UseNuGet("7.0.0", "https://api.nuget.org/v3/index.json")
8178
.ToToolchain());
8279
}
8380

@@ -221,9 +218,6 @@ public byte[] SixtyFourBytesArray()
221218
[Trait(Constants.Category, Constants.BackwardCompatibilityCategory)]
222219
public void AllocationQuantumIsNotAnIssueForNetCore21Plus(IToolchain toolchain)
223220
{
224-
if (toolchain is NativeAotToolchain) // the fix has not yet been backported to NativeAOT
225-
return;
226-
227221
long objectAllocationOverhead = IntPtr.Size * 2; // pointer to method table + object header word
228222
long arraySizeOverhead = IntPtr.Size; // array length
229223

@@ -263,9 +257,6 @@ public void Allocate()
263257
[Trait(Constants.Category, Constants.BackwardCompatibilityCategory)]
264258
public void MemoryDiagnoserIsAccurateForMultiThreadedBenchmarks(IToolchain toolchain)
265259
{
266-
if (toolchain is NativeAotToolchain) // the API has not been yet ported to NativeAOT
267-
return;
268-
269260
long objectAllocationOverhead = IntPtr.Size * 2; // pointer to method table + object header word
270261
long arraySizeOverhead = IntPtr.Size; // array length
271262
long memoryAllocatedPerArray = (MultiThreadedAllocation.Size + objectAllocationOverhead + arraySizeOverhead);
@@ -287,11 +278,6 @@ private void AssertAllocations(IToolchain toolchain, Type benchmarkType, Diction
287278

288279
foreach (var benchmarkAllocationsValidator in benchmarksAllocationsValidators)
289280
{
290-
// NativeAOT is missing some of the CoreCLR threading/task related perf improvements, so sizeof(Task<int>) calculated for CoreCLR < sizeof(Task<int>) on CoreRT
291-
// see https://github.com/dotnet/corert/issues/5705 for more
292-
if (benchmarkAllocationsValidator.Key == nameof(AccurateAllocations.AllocateTask) && toolchain is NativeAotToolchain)
293-
continue;
294-
295281
var allocatingBenchmarks = benchmarks.BenchmarksCases.Where(benchmark => benchmark.DisplayInfo.Contains(benchmarkAllocationsValidator.Key));
296282

297283
foreach (var benchmark in allocatingBenchmarks)
@@ -315,6 +301,8 @@ private IConfig CreateConfig(IToolchain toolchain)
315301
.WithWarmupCount(0) // don't run warmup to save some time for our CI runs
316302
.WithIterationCount(1) // single iteration is enough for us
317303
.WithGcForce(false)
304+
.WithGcServer(false)
305+
.WithGcConcurrent(false)
318306
.WithEnvironmentVariable("COMPlus_TieredCompilation", "0") // Tiered JIT can allocate some memory on a background thread, let's disable it to make our tests less flaky (#1542)
319307
.WithToolchain(toolchain))
320308
.AddColumnProvider(DefaultColumnProviders.Instance)

tests/BenchmarkDotNet.IntegrationTests/MonoTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ namespace BenchmarkDotNet.IntegrationTests
1010
public class MonoTests : BenchmarkTestExecutor
1111
{
1212
[FactDotNetCoreOnly("UseMonoRuntime option is available in .NET Core only starting from .NET 6")]
13-
public void Mono60IsSupported()
13+
public void Mono70IsSupported()
1414
{
15-
var config = ManualConfig.CreateEmpty().AddJob(Job.Dry.WithRuntime(MonoRuntime.Mono60));
15+
var config = ManualConfig.CreateEmpty().AddJob(Job.Dry.WithRuntime(MonoRuntime.Mono70));
1616
CanExecute<MonoBenchmark>(config);
1717
}
1818

tests/BenchmarkDotNet.IntegrationTests/MultipleRuntimesTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void SingleBenchmarkCanBeExecutedForMultipleRuntimes()
2929
var summary = BenchmarkRunner
3030
.Run<C>(
3131
ManualConfig.CreateEmpty()
32-
.AddJob(Job.Dry.WithRuntime(CoreRuntime.Core60).WithPlatform(Platform.X64).WithId("Core"))
32+
.AddJob(Job.Dry.WithRuntime(CoreRuntime.Core70).WithPlatform(Platform.X64).WithId("Core"))
3333
.AddJob(Job.Dry.WithRuntime(ClrRuntime.Net462).WithId("Framework"))
3434
.AddColumnProvider(DefaultColumnProviders.Instance)
3535
.AddLogger(new OutputLogger(output)));
@@ -51,7 +51,7 @@ public void SingleBenchmarkCanBeExecutedForMultipleRuntimes()
5151
.Any());
5252

5353
Assert.Contains(".NET Framework", summary.AllRuntimes);
54-
Assert.Contains(".NET 6.0", summary.AllRuntimes);
54+
Assert.Contains(".NET 7.0", summary.AllRuntimes);
5555
}
5656
}
5757

0 commit comments

Comments
 (0)