public void WhenBuildTakesMoreTimeThanTheTimeoutTheBuildIsCancelled()
        {
            if (!RuntimeInformation.Is64BitPlatform()) // NativeAOT does not support 32bit yet
            {
                return;
            }

            // we use NativeAOT on purpose because it takes a LOT of time to build it
            // so we can be sure that timeout = 1s should fail!
            var timeout = TimeSpan.FromSeconds(1);

            var config = ManualConfig.CreateEmpty()
                         .WithBuildTimeout(timeout)
                         .AddJob(Job.Dry
                                 .WithRuntime(NativeAotRuntime.Net60)
                                 .WithToolchain(NativeAotToolchain.CreateBuilder()
                                                .UseNuGet(
                                                    "6.0.0-rc.1.21420.1",                                                                          // we test against specific version to keep this test stable
                                                    "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json") // using old feed that supports net5.0
                                                .ToToolchain()));

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

            Assert.All(summary.Reports, report => Assert.False(report.BuildResult.IsBuildSuccess));
            Assert.All(summary.Reports, report => Assert.Contains("The configured timeout", report.BuildResult.ErrorMessage));
        }
Exemple #2
0
        public void LatestNativeAotVersionIsSupported()
        {
            if (!RuntimeInformation.Is64BitPlatform()) // NativeAOT does not support 32bit yet
            {
                return;
            }
            if (ContinuousIntegration.IsGitHubActionsOnWindows()) // no native dependencies installed
            {
                return;
            }
            if (ContinuousIntegration.IsAppVeyorOnWindows()) // too time consuming for AppVeyor (1h limit)
            {
                return;
            }
            if (NativeAotRuntime.GetCurrentVersion().RuntimeMoniker < RuntimeMoniker.NativeAot70) // we can't target net6.0 and use .NET 7 ILCompiler anymore (#2080)
            {
                return;
            }

            var toolchain = NativeAotToolchain.CreateBuilder().UseNuGet().IlcInstructionSet(IsAvx2Supported() ? "avx2" : "").ToToolchain();

            var config = ManualConfig.CreateEmpty()
                         .AddJob(Job.Dry
                                 .WithRuntime(NativeAotRuntime.GetCurrentVersion()) // we test against latest version for current TFM to make sure we avoid issues like #1055
                                 .WithToolchain(toolchain)
                                 .WithEnvironmentVariable(NativeAotBenchmark.EnvVarKey, IsAvx2Supported().ToString().ToLower()));

            CanExecute <NativeAotBenchmark>(config);
        }
Exemple #3
0
        public void CanBenchmarkLocalBuildUsingRyuJit()
        {
            var config = ManualConfig.CreateEmpty()
                         .AddJob(Job.Dry
                                 .WithRuntime(NativeAotRuntime.Net60)
                                 .WithToolchain(
                                     NativeAotToolchain.CreateBuilder()
                                     .UseLocalBuild(new System.IO.DirectoryInfo(IlcPath))
                                     .ToToolchain()));

            CanExecute <NativeAotBenchmark>(config);
        }