From 05b3040f85b78361b63c05ad48bb105b4f3049da Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sun, 29 Jul 2018 12:09:56 -0700 Subject: [PATCH 1/2] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 15 ++++++++------- korebuild-lock.txt | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 607267c52c..0f57ae33b0 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,12 +3,12 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.2.0-preview1-17099 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 + 2.2.0-preview1-17102 + 2.2.0-preview1-34823 + 2.2.0-preview1-34823 + 2.2.0-preview1-34823 + 2.2.0-preview1-34823 + 2.2.0-preview1-34823 2.0.9 2.1.2 2.2.0-preview1-26618-02 @@ -18,7 +18,8 @@ 4.5.0 9.0.1 2.3.1 - 2.4.0-rc.1.build4038 + 2.4.0 + diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 8b9d17825f..28cd6a5b03 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.2.0-preview1-17099 -commithash:263ed1db9866b6b419b1f5d5189a712aa218acb3 +version:2.2.0-preview1-17102 +commithash:e7e2b5a97ca92cfc6acc4def534cb0901a6d1eb9 From 4baed363e5c96c3774627cc6eb01740c289eeff1 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Mon, 30 Jul 2018 15:54:16 -0700 Subject: [PATCH 2/2] Close #467 - fix race conditions in tests that restart a watchable app * Ensure the test app is actually watching for file changes before attempting to trigger a restart. * Add retry if the first attempt times out --- .../DotNetWatcherTests.cs | 18 ++++++++++++++---- .../NoDepsAppTests.cs | 15 ++++++++++++--- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/test/dotnet-watch.FunctionalTests/DotNetWatcherTests.cs b/test/dotnet-watch.FunctionalTests/DotNetWatcherTests.cs index cc0a1c3fc0..65ff6416e2 100644 --- a/test/dotnet-watch.FunctionalTests/DotNetWatcherTests.cs +++ b/test/dotnet-watch.FunctionalTests/DotNetWatcherTests.cs @@ -39,15 +39,25 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests var source = Path.Combine(_app.SourceDirectory, "Program.cs"); var contents = File.ReadAllText(source); const string messagePrefix = "DOTNET_WATCH_ITERATION = "; - for (var i = 1; i <= 4; i++) + for (var i = 1; i <= 3; i++) { var message = await _app.Process.GetOutputLineStartsWithAsync(messagePrefix, TimeSpan.FromMinutes(2)); var count = int.Parse(message.Substring(messagePrefix.Length), CultureInfo.InvariantCulture); Assert.Equal(i, count); - File.Delete(source); - File.WriteAllText(source, contents); - await _app.HasRestarted(); + await _app.IsWaitingForFileChange(); + + try + { + File.SetLastWriteTime(source, DateTime.Now); + await _app.HasRestarted(); + } + catch + { + // retry + File.SetLastWriteTime(source, DateTime.Now); + await _app.HasRestarted(); + } } } diff --git a/test/dotnet-watch.FunctionalTests/NoDepsAppTests.cs b/test/dotnet-watch.FunctionalTests/NoDepsAppTests.cs index 22f46cbbe0..55d0441552 100644 --- a/test/dotnet-watch.FunctionalTests/NoDepsAppTests.cs +++ b/test/dotnet-watch.FunctionalTests/NoDepsAppTests.cs @@ -53,10 +53,19 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests await _app.IsWaitingForFileChange(); var fileToChange = Path.Combine(_app.SourceDirectory, "Program.cs"); - var programCs = File.ReadAllText(fileToChange); - File.WriteAllText(fileToChange, programCs); - await _app.HasRestarted(); + try + { + File.SetLastWriteTime(fileToChange, DateTime.Now); + await _app.HasRestarted(); + } + catch + { + // retry + File.SetLastWriteTime(fileToChange, DateTime.Now); + await _app.HasRestarted(); + } + var pid2 = await _app.GetProcessId(); Assert.NotEqual(pid, pid2); await _app.HasExited(); // process should exit after run