From fd5cd4302211ada851a2e547309f47528800fdd2 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 9 May 2022 23:07:42 +0000 Subject: [PATCH] [release/6.0] Update dependencies from dotnet/arcade (#41518) * Update dependencies from https://github.com/dotnet/arcade build 20220504.3 Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Helix.Sdk From Version 6.0.0-beta.22212.5 -> To Version 6.0.0-beta.22254.3 * Harden another shadow copy test (#37083) * Backport HttpLogging test fixes Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Hao Kung <HaoK@users.noreply.github.com> Co-authored-by: Will Godbe <wigodbe@microsoft.com> --- NuGet.config | 4 ---- eng/Version.Details.xml | 16 ++++++++-------- eng/Versions.props | 4 ++-- global.json | 4 ++-- .../HttpLogging/src/W3CLoggerProcessor.cs | 2 +- .../HttpLogging/test/W3CLoggerTests.cs | 10 +++++++--- .../test/W3CLoggingMiddlewareTests.cs | 12 ++++++++---- .../test/IIS.FunctionalTests/ShadowCopyTests.cs | 2 +- 8 files changed, 29 insertions(+), 25 deletions(-) diff --git a/NuGet.config b/NuGet.config index 76ccfd79eee..4b821f80099 100644 --- a/NuGet.config +++ b/NuGet.config @@ -4,10 +4,8 @@ <clear /> <!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.--> <!-- Begin: Package sources from dotnet-runtime --> - <add key="darc-int-dotnet-runtime-be98e88" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-runtime-be98e88c/nuget/v3/index.json" /> <!-- End: Package sources from dotnet-runtime --> <!-- Begin: Package sources from dotnet-efcore --> - <add key="darc-int-dotnet-efcore-aca50ae" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-efcore-aca50aef/nuget/v3/index.json" /> <!-- End: Package sources from dotnet-efcore --> <!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.--> <add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" /> @@ -27,10 +25,8 @@ <clear /> <!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.--> <!-- Begin: Package sources from dotnet-efcore --> - <add key="darc-int-dotnet-efcore-aca50ae" value="true" /> <!-- End: Package sources from dotnet-efcore --> <!-- Begin: Package sources from dotnet-runtime --> - <add key="darc-int-dotnet-runtime-be98e88" value="true" /> <!-- End: Package sources from dotnet-runtime --> <!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.--> </disabledPackageSources> diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 252b1487351..761f0375d24 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -280,22 +280,22 @@ <Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri> <Sha>be98e88c760526452df94ef452fff4602fb5bded</Sha> </Dependency> - <Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.22212.5"> + <Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.22254.3"> <Uri>https://github.com/dotnet/arcade</Uri> - <Sha>1a6b24397e50146d0fece9cfb9c0b87275691e6f</Sha> + <Sha>5fdd5b6c08c6c39edf12001400a11786c03b3e35</Sha> <SourceBuild RepoName="arcade" ManagedOnly="true" /> </Dependency> - <Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="6.0.0-beta.22212.5"> + <Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="6.0.0-beta.22254.3"> <Uri>https://github.com/dotnet/arcade</Uri> - <Sha>1a6b24397e50146d0fece9cfb9c0b87275691e6f</Sha> + <Sha>5fdd5b6c08c6c39edf12001400a11786c03b3e35</Sha> </Dependency> - <Dependency Name="Microsoft.DotNet.Build.Tasks.Templating" Version="6.0.0-beta.22212.5"> + <Dependency Name="Microsoft.DotNet.Build.Tasks.Templating" Version="6.0.0-beta.22254.3"> <Uri>https://github.com/dotnet/arcade</Uri> - <Sha>1a6b24397e50146d0fece9cfb9c0b87275691e6f</Sha> + <Sha>5fdd5b6c08c6c39edf12001400a11786c03b3e35</Sha> </Dependency> - <Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="6.0.0-beta.22212.5"> + <Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="6.0.0-beta.22254.3"> <Uri>https://github.com/dotnet/arcade</Uri> - <Sha>1a6b24397e50146d0fece9cfb9c0b87275691e6f</Sha> + <Sha>5fdd5b6c08c6c39edf12001400a11786c03b3e35</Sha> </Dependency> </ToolsetDependencies> </Dependencies> diff --git a/eng/Versions.props b/eng/Versions.props index 83e23d0b8b0..3e7361d33eb 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -131,8 +131,8 @@ <MicrosoftEntityFrameworkCoreVersion>6.0.4</MicrosoftEntityFrameworkCoreVersion> <MicrosoftEntityFrameworkCoreDesignVersion>6.0.4</MicrosoftEntityFrameworkCoreDesignVersion> <!-- Packages from dotnet/arcade --> - <MicrosoftDotNetBuildTasksInstallersVersion>6.0.0-beta.22212.5</MicrosoftDotNetBuildTasksInstallersVersion> - <MicrosoftDotNetBuildTasksTemplatingVersion>6.0.0-beta.22212.5</MicrosoftDotNetBuildTasksTemplatingVersion> + <MicrosoftDotNetBuildTasksInstallersVersion>6.0.0-beta.22254.3</MicrosoftDotNetBuildTasksInstallersVersion> + <MicrosoftDotNetBuildTasksTemplatingVersion>6.0.0-beta.22254.3</MicrosoftDotNetBuildTasksTemplatingVersion> </PropertyGroup> <!-- diff --git a/global.json b/global.json index 30a17d2cce7..9cb19f0e265 100644 --- a/global.json +++ b/global.json @@ -29,7 +29,7 @@ }, "msbuild-sdks": { "Yarn.MSBuild": "1.22.10", - "Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.22212.5", - "Microsoft.DotNet.Helix.Sdk": "6.0.0-beta.22212.5" + "Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.22254.3", + "Microsoft.DotNet.Helix.Sdk": "6.0.0-beta.22254.3" } } diff --git a/src/Middleware/HttpLogging/src/W3CLoggerProcessor.cs b/src/Middleware/HttpLogging/src/W3CLoggerProcessor.cs index 749da2b6cfb..d3a44994a8b 100644 --- a/src/Middleware/HttpLogging/src/W3CLoggerProcessor.cs +++ b/src/Middleware/HttpLogging/src/W3CLoggerProcessor.cs @@ -27,7 +27,7 @@ namespace Microsoft.AspNetCore.HttpLogging { await WriteMessageAsync("#Version: 1.0", streamWriter, cancellationToken); - await WriteMessageAsync("#Start-Date: " + DateTimeOffset.UtcNow.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture), streamWriter, cancellationToken); + await WriteMessageAsync("#Start-Date: " + DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture), streamWriter, cancellationToken); await WriteMessageAsync(GetFieldsDirective(), streamWriter, cancellationToken); } diff --git a/src/Middleware/HttpLogging/test/W3CLoggerTests.cs b/src/Middleware/HttpLogging/test/W3CLoggerTests.cs index 759f6354ea8..078aa5af4c4 100644 --- a/src/Middleware/HttpLogging/test/W3CLoggerTests.cs +++ b/src/Middleware/HttpLogging/test/W3CLoggerTests.cs @@ -25,7 +25,7 @@ namespace Microsoft.AspNetCore.HttpLogging public async Task WritesDateTime() { var path = Path.GetTempFileName() + "_"; - var now = DateTime.Now; + var now = DateTime.UtcNow; var options = new W3CLoggerOptions() { LoggingFields = W3CLoggingFields.Date | W3CLoggingFields.Time, @@ -48,7 +48,9 @@ namespace Microsoft.AspNetCore.HttpLogging Assert.StartsWith("#Start-Date: ", lines[1]); var startDate = DateTime.Parse(lines[1].Substring(13), CultureInfo.InvariantCulture); // Assert that the log was written in the last 10 seconds - Assert.True(now.Subtract(startDate).TotalSeconds < 10); + // W3CLogger writes start-time to second precision, so delta could be as low as -0.999... + var delta = startDate.Subtract(now).TotalSeconds; + Assert.InRange(delta, -1, 10); Assert.Equal("#Fields: date time", lines[2]); @@ -89,7 +91,9 @@ namespace Microsoft.AspNetCore.HttpLogging Assert.StartsWith("#Start-Date: ", lines[1]); var startDate = DateTime.Parse(lines[1].Substring(13), CultureInfo.InvariantCulture); // Assert that the log was written in the last 10 seconds - Assert.True(now.Subtract(startDate).TotalSeconds < 10); + // W3CLogger writes start-time to second precision, so delta could be as low as -0.999... + var delta = startDate.Subtract(now).TotalSeconds; + Assert.InRange(delta, -1, 10); Assert.Equal("#Fields: cs-uri-query sc-status cs-host", lines[2]); Assert.Equal("- - -", lines[3]); diff --git a/src/Middleware/HttpLogging/test/W3CLoggingMiddlewareTests.cs b/src/Middleware/HttpLogging/test/W3CLoggingMiddlewareTests.cs index e1f1d0ab684..9c4a20f3e72 100644 --- a/src/Middleware/HttpLogging/test/W3CLoggingMiddlewareTests.cs +++ b/src/Middleware/HttpLogging/test/W3CLoggingMiddlewareTests.cs @@ -94,7 +94,7 @@ namespace Microsoft.AspNetCore.HttpLogging httpContext.Request.Headers["Cookie"] = "Snickerdoodle"; httpContext.Response.StatusCode = 200; - var now = DateTime.Now; + var now = DateTime.UtcNow; await middleware.Invoke(httpContext); await logger.Processor.WaitForWrites(4).DefaultTimeout(); @@ -104,7 +104,9 @@ namespace Microsoft.AspNetCore.HttpLogging Assert.StartsWith("#Start-Date: ", lines[1]); var startDate = DateTime.Parse(lines[1].Substring(13), CultureInfo.InvariantCulture); // Assert that the log was written in the last 10 seconds - Assert.True(now.Subtract(startDate).TotalSeconds < 10); + // W3CLogger writes start-time to second precision, so delta could be as low as -0.999... + var delta = startDate.Subtract(now).TotalSeconds; + Assert.InRange(delta, -1, 10); Assert.Equal("#Fields: date time c-ip s-computername s-ip s-port cs-method cs-uri-stem cs-uri-query sc-status time-taken cs-version cs-host cs(User-Agent) cs(Referer)", lines[2]); Assert.DoesNotContain(lines[3], "Snickerdoodle"); @@ -128,7 +130,7 @@ namespace Microsoft.AspNetCore.HttpLogging var httpContext = new DefaultHttpContext(); - var now = DateTime.Now; + var now = DateTime.UtcNow; await middleware.Invoke(httpContext); await logger.Processor.WaitForWrites(4).DefaultTimeout(); @@ -138,7 +140,9 @@ namespace Microsoft.AspNetCore.HttpLogging Assert.StartsWith("#Start-Date: ", lines[1]); var startDate = DateTime.Parse(lines[1].Substring(13), CultureInfo.InvariantCulture); // Assert that the log was written in the last 10 seconds - Assert.True(now.Subtract(startDate).TotalSeconds < 10); + // W3CLogger writes start-time to second precision, so delta could be as low as -0.999... + var delta = startDate.Subtract(now).TotalSeconds; + Assert.InRange(delta, -1, 10); Assert.Equal("#Fields: time-taken", lines[2]); double num; diff --git a/src/Servers/IIS/IIS/test/IIS.FunctionalTests/ShadowCopyTests.cs b/src/Servers/IIS/IIS/test/IIS.FunctionalTests/ShadowCopyTests.cs index 375bf607eae..cdf62949405 100644 --- a/src/Servers/IIS/IIS/test/IIS.FunctionalTests/ShadowCopyTests.cs +++ b/src/Servers/IIS/IIS/test/IIS.FunctionalTests/ShadowCopyTests.cs @@ -199,7 +199,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests // Depending on timing, this could result in a shutdown failure, but sometimes it succeeds, handle both situations if (!response.IsSuccessStatusCode) { - Assert.Equal("Application Shutting Down", response.ReasonPhrase); + Assert.True(response.ReasonPhrase == "Application Shutting Down" || response.ReasonPhrase == "Server has been shutdown"); } // This shutdown should trigger a copy to the next highest directory, which will be 2 -- GitLab