From aee40dbd369a5062a7a91b45f8ce40759e3cb277 Mon Sep 17 00:00:00 2001
From: Brennan <brecon@microsoft.com>
Date: Fri, 10 Jul 2020 15:34:10 -0700
Subject: [PATCH] Quarantine flaky Watch tests (#23855)

---
 src/Tools/Tools.slnf                          | 29 ++++++++++---------
 .../dotnet-watch/test/DotNetWatcherTests.cs   |  7 +++++
 2 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/src/Tools/Tools.slnf b/src/Tools/Tools.slnf
index 56917a9a4f4..813a7aa9084 100644
--- a/src/Tools/Tools.slnf
+++ b/src/Tools/Tools.slnf
@@ -1,22 +1,23 @@
-{
+{
   "solution": {
     "path": "..\\..\\AspNetCore.sln",
-    "projects" : [
-      "src\\Tools\\dotnet-watch\\src\\dotnet-watch.csproj",
-      "src\\Tools\\dotnet-watch\\test\\dotnet-watch.Tests.csproj",
+    "projects": [
+      "src\\Testing\\src\\Microsoft.AspNetCore.Testing.csproj",
+      "src\\Tools\\Extensions.ApiDescription.Client\\src\\Microsoft.Extensions.ApiDescription.Client.csproj",
+      "src\\Tools\\Extensions.ApiDescription.Client\\test\\Microsoft.Extensions.ApiDescription.Client.Tests.csproj",
+      "src\\Tools\\Extensions.ApiDescription.Server\\src\\Microsoft.Extensions.ApiDescription.Server.csproj",
+      "src\\Tools\\FirstRunCertGenerator\\src\\Microsoft.AspNetCore.DeveloperCertificates.XPlat.csproj",
+      "src\\Tools\\FirstRunCertGenerator\\test\\Microsoft.AspNetCore.DeveloperCertificates.XPlat.Tests.csproj",
+      "src\\Tools\\GetDocumentInsider\\src\\GetDocumentInsider.csproj",
+      "src\\Tools\\Microsoft.dotnet-openapi\\src\\Microsoft.dotnet-openapi.csproj",
+      "src\\Tools\\Microsoft.dotnet-openapi\\test\\dotnet-microsoft.openapi.Tests.csproj",
       "src\\Tools\\dotnet-dev-certs\\src\\dotnet-dev-certs.csproj",
+      "src\\Tools\\dotnet-getdocument\\src\\dotnet-getdocument.csproj",
       "src\\Tools\\dotnet-sql-cache\\src\\dotnet-sql-cache.csproj",
       "src\\Tools\\dotnet-user-secrets\\src\\dotnet-user-secrets.csproj",
       "src\\Tools\\dotnet-user-secrets\\test\\dotnet-user-secrets.Tests.csproj",
-      "src\\Tools\\Microsoft.dotnet-openapi\\src\\Microsoft.dotnet-openapi.csproj",
-      "src\\Tools\\Microsoft.dotnet-openapi\\test\\dotnet-microsoft.openapi.Tests.csproj",
-      "src\\Tools\\Extensions.ApiDescription.Client\\src\\Microsoft.Extensions.ApiDescription.Client.csproj",
-      "src\\Tools\\dotnet-getdocument\\src\\dotnet-getdocument.csproj",
-      "src\\Tools\\Extensions.ApiDescription.Server\\src\\Microsoft.Extensions.ApiDescription.Server.csproj",
-      "src\\Tools\\GetDocumentInsider\\src\\GetDocumentInsider.csproj",
-      "src\\Tools\\Extensions.ApiDescription.Client\\test\\Microsoft.Extensions.ApiDescription.Client.Tests.csproj",
-      "src\\Tools\\FirstRunCertGenerator\\test\\Microsoft.AspNetCore.DeveloperCertificates.XPlat.Tests.csproj",
-      "src\\Tools\\FirstRunCertGenerator\\src\\Microsoft.AspNetCore.DeveloperCertificates.XPlat.csproj"
+      "src\\Tools\\dotnet-watch\\src\\dotnet-watch.csproj",
+      "src\\Tools\\dotnet-watch\\test\\dotnet-watch.Tests.csproj"
     ]
   }
-}
+}
\ No newline at end of file
diff --git a/src/Tools/dotnet-watch/test/DotNetWatcherTests.cs b/src/Tools/dotnet-watch/test/DotNetWatcherTests.cs
index a2bb54a93bf..eabf66a584e 100644
--- a/src/Tools/dotnet-watch/test/DotNetWatcherTests.cs
+++ b/src/Tools/dotnet-watch/test/DotNetWatcherTests.cs
@@ -5,6 +5,7 @@ using System;
 using System.Globalization;
 using System.IO;
 using System.Threading.Tasks;
+using Microsoft.AspNetCore.Testing;
 using Xunit;
 using Xunit.Abstractions;
 
@@ -54,6 +55,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests
         }
 
         [Fact]
+        [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/23854")]
         public async Task RunsWithNoRestoreOnOrdinaryFileChanges()
         {
             _app.DotnetWatchArgs.Add("--verbose");
@@ -71,10 +73,13 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests
                 var message = await _app.Process.GetOutputLineStartsWithAsync(messagePrefix, TimeSpan.FromMinutes(2));
 
                 Assert.Equal(messagePrefix + " --no-restore -- wait", message.Trim());
+
+                await _app.HasRestarted();
             }
         }
 
         [Fact]
+        [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/23854")]
         public async Task RunsWithRestoreIfCsprojChanges()
         {
             _app.DotnetWatchArgs.Add("--verbose");
@@ -92,6 +97,8 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests
             // csproj changed. Do not expect a --no-restore
             Assert.Equal(messagePrefix + " -- wait", message.Trim());
 
+            await _app.HasRestarted();
+
             // regular file changed after csproj changes. Should use --no-restore
             File.SetLastWriteTime(Path.Combine(_app.SourceDirectory, "Program.cs"), DateTime.Now);
             message = await _app.Process.GetOutputLineStartsWithAsync(messagePrefix, TimeSpan.FromMinutes(2));
-- 
GitLab