From 2365dced43977c702fa8f98ebbb5160b9ef43960 Mon Sep 17 00:00:00 2001 From: BrennanConroy Date: Fri, 8 Feb 2019 14:37:53 -0800 Subject: [PATCH 1/5] Fix flaky process output reading for dotnet-watch tests (#7173) --- build/RepositoryBuild.targets | 7 ++-- build/buildorder.props | 2 +- .../src/Internal/ProcessRunner.cs | 33 +++++++++++-------- .../dotnet-watch/test/DotNetWatcherTests.cs | 15 ++------- .../test/Properties/AssemblyInfo.cs | 7 ++++ .../test/Scenario/WatchableApp.cs | 9 +++-- 6 files changed, 39 insertions(+), 34 deletions(-) create mode 100644 src/Tools/dotnet-watch/test/Properties/AssemblyInfo.cs diff --git a/build/RepositoryBuild.targets b/build/RepositoryBuild.targets index 3a2214a929..ee91e3a2ca 100644 --- a/build/RepositoryBuild.targets +++ b/build/RepositoryBuild.targets @@ -19,7 +19,8 @@ %(RepositoryBuildOrder.Identity) RepositoryToBuild=%(RepositoryBuildOrder.Identity); - BuildRepositoryRoot=$([MSBuild]::NormalizeDirectory(%(RepositoryBuildOrder.RootPath))) + BuildRepositoryRoot=$([MSBuild]::NormalizeDirectory(%(RepositoryBuildOrder.RootPath))); + SkipTests=%(RepositoryBuildOrder.SkipTests) @@ -171,7 +172,7 @@ - - + diff --git a/build/buildorder.props b/build/buildorder.props index 12b7cf9e85..13f9bc8ee3 100644 --- a/build/buildorder.props +++ b/build/buildorder.props @@ -7,7 +7,7 @@ - + diff --git a/src/Tools/dotnet-watch/src/Internal/ProcessRunner.cs b/src/Tools/dotnet-watch/src/Internal/ProcessRunner.cs index bbded25611..7874d592b6 100644 --- a/src/Tools/dotnet-watch/src/Internal/ProcessRunner.cs +++ b/src/Tools/dotnet-watch/src/Internal/ProcessRunner.cs @@ -37,17 +37,31 @@ namespace Microsoft.DotNet.Watcher.Internal { cancellationToken.Register(() => processState.TryKill()); + process.OutputDataReceived += (_, a) => + { + if (!string.IsNullOrEmpty(a.Data)) + { + processSpec.OutputCapture.AddLine(a.Data); + } + }; + process.ErrorDataReceived += (_, a) => + { + if (!string.IsNullOrEmpty(a.Data)) + { + processSpec.OutputCapture.AddLine(a.Data); + } + }; + stopwatch.Start(); process.Start(); + _reporter.Verbose($"Started '{processSpec.Executable}' with process id {process.Id}"); if (processSpec.IsOutputCaptured) { - await Task.WhenAll( - processState.Task, - ConsumeStreamAsync(process.StandardOutput, processSpec.OutputCapture.AddLine), - ConsumeStreamAsync(process.StandardError, processSpec.OutputCapture.AddLine) - ); + process.BeginErrorReadLine(); + process.BeginOutputReadLine(); + await processState.Task; } else { @@ -86,15 +100,6 @@ namespace Microsoft.DotNet.Watcher.Internal return process; } - private static async Task ConsumeStreamAsync(StreamReader reader, Action consume) - { - string line; - while ((line = await reader.ReadLineAsync().ConfigureAwait(false)) != null) - { - consume?.Invoke(line); - } - } - private class ProcessState : IDisposable { private readonly IReporter _reporter; diff --git a/src/Tools/dotnet-watch/test/DotNetWatcherTests.cs b/src/Tools/dotnet-watch/test/DotNetWatcherTests.cs index d31f650aa6..7a38b94926 100644 --- a/src/Tools/dotnet-watch/test/DotNetWatcherTests.cs +++ b/src/Tools/dotnet-watch/test/DotNetWatcherTests.cs @@ -49,19 +49,8 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests await _app.IsWaitingForFileChange(); - try - { - File.SetLastWriteTime(source, DateTime.Now); - await _app.HasRestarted(); - } - catch (Exception ex) - { - _logger.WriteLine("Retrying. First attempt to restart app failed: " + ex.Message); - - // retry - File.SetLastWriteTime(source, DateTime.Now); - await _app.HasRestarted(); - } + File.SetLastWriteTime(source, DateTime.Now); + await _app.HasRestarted(TimeSpan.FromMinutes(1)); } } diff --git a/src/Tools/dotnet-watch/test/Properties/AssemblyInfo.cs b/src/Tools/dotnet-watch/test/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..d8e6c031be --- /dev/null +++ b/src/Tools/dotnet-watch/test/Properties/AssemblyInfo.cs @@ -0,0 +1,7 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using Microsoft.AspNetCore.Testing.xunit; +using Xunit; + +[assembly: CollectionBehavior(DisableTestParallelization = true)] \ No newline at end of file diff --git a/src/Tools/dotnet-watch/test/Scenario/WatchableApp.cs b/src/Tools/dotnet-watch/test/Scenario/WatchableApp.cs index 4f2d575f01..7297c58ce1 100644 --- a/src/Tools/dotnet-watch/test/Scenario/WatchableApp.cs +++ b/src/Tools/dotnet-watch/test/Scenario/WatchableApp.cs @@ -42,7 +42,10 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests public string SourceDirectory { get; } public Task HasRestarted() - => Process.GetOutputLineAsync(StartedMessage, DefaultMessageTimeOut); + => HasRestarted(DefaultMessageTimeOut); + + public Task HasRestarted(TimeSpan timeout) + => Process.GetOutputLineAsync(StartedMessage, timeout); public async Task HasExited() { @@ -50,9 +53,9 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests await Process.GetOutputLineStartsWithAsync(WatchExitedMessage, DefaultMessageTimeOut); } - public async Task IsWaitingForFileChange() + public Task IsWaitingForFileChange() { - await Process.GetOutputLineStartsWithAsync(WaitingForFileChangeMessage, DefaultMessageTimeOut); + return Process.GetOutputLineStartsWithAsync(WaitingForFileChangeMessage, DefaultMessageTimeOut); } public bool UsePollingWatcher { get; set; } From 5bb5bafbed554f8391ff779c02cfb438a850f621 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Tue, 12 Feb 2019 18:22:58 -0800 Subject: [PATCH 2/5] Update branding to 2.1.9 --- build/submodules.props | 2 +- eng/Baseline.Designer.props | 4 ++-- eng/Baseline.xml | 4 ++-- eng/PatchConfig.props | 4 ++++ .../Archive.CiServer.Patch.Compat/ArchiveBaseline.2.1.8.txt | 5 +++++ .../Archive.CiServer.Patch/ArchiveBaseline.2.1.8.txt | 5 +++++ version.props | 2 +- 7 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.1.8.txt create mode 100644 src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.1.8.txt diff --git a/build/submodules.props b/build/submodules.props index a088430493..4370c412c7 100644 --- a/build/submodules.props +++ b/build/submodules.props @@ -37,6 +37,6 @@ - + diff --git a/eng/Baseline.Designer.props b/eng/Baseline.Designer.props index fca94be07c..14f2dfd4bc 100644 --- a/eng/Baseline.Designer.props +++ b/eng/Baseline.Designer.props @@ -2,7 +2,7 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.7 + 2.1.8 @@ -120,7 +120,7 @@ - 2.1.2 + 2.1.8 diff --git a/eng/Baseline.xml b/eng/Baseline.xml index adc7afcb87..01f155f88e 100644 --- a/eng/Baseline.xml +++ b/eng/Baseline.xml @@ -4,7 +4,7 @@ This file contains a list of all the packages and their versions which were rele build of ASP.NET Core 2.1.x. Update this list when preparing for a new patch. --> - + @@ -17,7 +17,7 @@ build of ASP.NET Core 2.1.x. Update this list when preparing for a new patch. - + diff --git a/eng/PatchConfig.props b/eng/PatchConfig.props index 0a6db36788..70a6297f74 100644 --- a/eng/PatchConfig.props +++ b/eng/PatchConfig.props @@ -19,4 +19,8 @@ Later on, this will be checked using this condition: + + + + diff --git a/src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.1.8.txt b/src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.1.8.txt new file mode 100644 index 0000000000..d24b04eefb --- /dev/null +++ b/src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.1.8.txt @@ -0,0 +1,5 @@ +microsoft.aspnetcore.razor.design\2.1.1\.nupkg.metadata +system.buffers\4.3.0\.signature.p7s +system.collections.immutable\1.3.0\.signature.p7s +system.diagnostics.contracts\4.3.0\.signature.p7s +system.runtime.serialization.primitives\4.1.1\.signature.p7s diff --git a/src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.1.8.txt b/src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.1.8.txt new file mode 100644 index 0000000000..d24b04eefb --- /dev/null +++ b/src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.1.8.txt @@ -0,0 +1,5 @@ +microsoft.aspnetcore.razor.design\2.1.1\.nupkg.metadata +system.buffers\4.3.0\.signature.p7s +system.collections.immutable\1.3.0\.signature.p7s +system.diagnostics.contracts\4.3.0\.signature.p7s +system.runtime.serialization.primitives\4.1.1\.signature.p7s diff --git a/version.props b/version.props index 94a3f4ccb9..c696d687f3 100644 --- a/version.props +++ b/version.props @@ -2,7 +2,7 @@ 2 1 - 8 + 9 servicing Servicing t000 From 05895cde64ad37f1f778a5d9867c6d7e64f8b869 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Thu, 14 Feb 2019 17:48:22 +1300 Subject: [PATCH 3/5] Fix endpoint routing flaky test on build server in 2.2 (#7489) --- .../test/UnitTests/Matching/DfaMatcherBuilderTest.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Http/Routing/test/UnitTests/Matching/DfaMatcherBuilderTest.cs b/src/Http/Routing/test/UnitTests/Matching/DfaMatcherBuilderTest.cs index 2eff433602..507f85de44 100644 --- a/src/Http/Routing/test/UnitTests/Matching/DfaMatcherBuilderTest.cs +++ b/src/Http/Routing/test/UnitTests/Matching/DfaMatcherBuilderTest.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -231,7 +231,9 @@ namespace Microsoft.AspNetCore.Routing.Matching Assert.Null(root.Parameters); var next = Assert.Single(root.Literals); - Assert.Equal("a", next.Key); + // Ignore case in 2.2 because EndpointComparer.ComparePattern does not specify a culture and running in the wrong culture + // will change the order of results. This causes 'A' to be used instead of 'a' + Assert.Equal("a", next.Key, ignoreCase: true); var a = next.Value; Assert.Null(a.Matches); From d102d10a812004f798c86cf3d80e2e24c0e72e5a Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Tue, 12 Feb 2019 18:56:27 -0800 Subject: [PATCH 4/5] Update branding to 2.2.3 - new version - update baselines - grab latest released Microsoft.NetCore.App and Microsoft.NETCore.DotNetAppHost nit: - updated ZipManifestGenerator's README.md to use 2.2 examples --- build/dependencies.props | 4 +-- eng/Baseline.Designer.props | 27 ++++++++++--------- eng/Baseline.xml | 18 ++++++------- eng/PatchConfig.props | 5 +++- .../ArchiveBaseline.2.2.2.txt | 1 + .../ArchiveBaseline.2.2.2.txt | 1 + .../ZipManifestGenerator/README.md | 6 ++--- version.props | 2 +- 8 files changed, 35 insertions(+), 29 deletions(-) create mode 100644 src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.2.2.txt create mode 100644 src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.2.2.txt diff --git a/build/dependencies.props b/build/dependencies.props index 3c28d54eb0..b2e17ce93e 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -2,8 +2,8 @@ - 2.2.1 - 2.2.1 + 2.2.2 + 2.2.2 diff --git a/eng/Baseline.Designer.props b/eng/Baseline.Designer.props index 98b5c9206c..0bca2a489a 100644 --- a/eng/Baseline.Designer.props +++ b/eng/Baseline.Designer.props @@ -2,7 +2,7 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.2.1 + 2.2.2 @@ -81,8 +81,9 @@ - 2.2.1 + 2.2.2 + 2.2.0 @@ -137,7 +138,7 @@ - 2.2.0 + 2.2.2 @@ -220,7 +221,7 @@ - 2.2.0 + 2.2.2 @@ -236,7 +237,7 @@ - 2.2.0 + 2.2.2 @@ -528,14 +529,14 @@ - 2.2.0 + 2.2.2 - + @@ -656,15 +657,15 @@ - 2.2.0 + 2.2.2 - + @@ -934,18 +935,18 @@ - 2.2.0 + 2.2.2 - + - + @@ -963,7 +964,7 @@ - 2.2.1 + 2.2.2 diff --git a/eng/Baseline.xml b/eng/Baseline.xml index 0510268f25..f6e6959091 100644 --- a/eng/Baseline.xml +++ b/eng/Baseline.xml @@ -4,7 +4,7 @@ This file contains a list of all the packages and their versions which were rele build of ASP.NET Core 2.2.x. Update this list when preparing for a new patch. --> - + @@ -13,14 +13,14 @@ build of ASP.NET Core 2.2.x. Update this list when preparing for a new patch. - + - + @@ -30,8 +30,8 @@ build of ASP.NET Core 2.2.x. Update this list when preparing for a new patch. - - + + @@ -61,7 +61,7 @@ build of ASP.NET Core 2.2.x. Update this list when preparing for a new patch. - + @@ -75,7 +75,7 @@ build of ASP.NET Core 2.2.x. Update this list when preparing for a new patch. - + @@ -101,9 +101,9 @@ build of ASP.NET Core 2.2.x. Update this list when preparing for a new patch. - + - + diff --git a/eng/PatchConfig.props b/eng/PatchConfig.props index 7e408b0dcc..5951ed8785 100644 --- a/eng/PatchConfig.props +++ b/eng/PatchConfig.props @@ -39,5 +39,8 @@ Later on, this will be checked using this condition: java:signalr; - + + + + diff --git a/src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.2.2.txt b/src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.2.2.txt new file mode 100644 index 0000000000..305167059a --- /dev/null +++ b/src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.2.2.txt @@ -0,0 +1 @@ +system.reflection.emit\4.0.1\.signature.p7s diff --git a/src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.2.2.txt b/src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.2.2.txt new file mode 100644 index 0000000000..305167059a --- /dev/null +++ b/src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.2.2.txt @@ -0,0 +1 @@ +system.reflection.emit\4.0.1\.signature.p7s diff --git a/src/PackageArchive/ZipManifestGenerator/README.md b/src/PackageArchive/ZipManifestGenerator/README.md index 6022e996b8..f5bbe7d3b2 100644 --- a/src/PackageArchive/ZipManifestGenerator/README.md +++ b/src/PackageArchive/ZipManifestGenerator/README.md @@ -19,13 +19,13 @@ To generate a new manifest for the incremental CI server package caches, you wou ```ps1 $ProdConBuild='20180919-01' -$Version='2.1.5' +$Version='2.2.1' -$patchUrl = "https://dotnetfeed.blob.core.windows.net/orchestrated-release-2-1/${ProdconBuild}/final/assets/aspnetcore/Runtime/${Version}/nuGetPackagesArchive-ci-server-${Version}.patch.zip" +$patchUrl = "https://dotnetfeed.blob.core.windows.net/orchestrated-release-2-2/${ProdconBuild}/final/assets/aspnetcore/Runtime/${Version}/nuGetPackagesArchive-ci-server-${Version}.patch.zip" dotnet run $patchUrl "../Archive.CiServer.Patch/ArchiveBaseline.${Version}.txt" -$compatPatchUrl = "https://dotnetfeed.blob.core.windows.net/orchestrated-release-2-1/${ProdconBuild}/final/assets/aspnetcore/Runtime/${Version}/nuGetPackagesArchive-ci-server-compat-${Version}.patch.zip" +$compatPatchUrl = "https://dotnetfeed.blob.core.windows.net/orchestrated-release-2-2/${ProdconBuild}/final/assets/aspnetcore/Runtime/${Version}/nuGetPackagesArchive-ci-server-compat-${Version}.patch.zip" dotnet run $compatPatchUrl "../Archive.CiServer.Patch.Compat/ArchiveBaseline.${Version}.txt" ``` diff --git a/version.props b/version.props index 5f2037a511..6a5491db68 100644 --- a/version.props +++ b/version.props @@ -2,7 +2,7 @@ 2 2 - 2 + 3 servicing $([System.DateTime]::Now.ToString('yyMMdd'))-99 From 55bedc1cf9df09371296d0ef27131578c5f8100f Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Wed, 13 Feb 2019 15:51:20 -0800 Subject: [PATCH 5/5] Don't build site extensions --- build/repo.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/repo.props b/build/repo.props index b04650faa6..a5c52bca3f 100644 --- a/build/repo.props +++ b/build/repo.props @@ -18,7 +18,7 @@ $(RepositoryRoot)eng\signcheck.exclusions.txt $(RepositoryRoot)src\Shared\ $(SharedFxRid.Substring($([MSBuild]::Add($(SharedFxRid.LastIndexOf('-')), 1)))) - true + false false