diff --git a/test/dotnet-watch.Tests/HotReload/ApplyDeltaTests.cs b/test/dotnet-watch.Tests/HotReload/ApplyDeltaTests.cs index 095822120c0d..6dc2111c1c49 100644 --- a/test/dotnet-watch.Tests/HotReload/ApplyDeltaTests.cs +++ b/test/dotnet-watch.Tests/HotReload/ApplyDeltaTests.cs @@ -516,9 +516,10 @@ public async Task AutoRestartOnRudeEditAfterRestartPrompt() // rude edit: adding virtual method UpdateSourceFile(programPath, src => src.Replace("/* member placeholder */", "public virtual void F() {}")); + // the prompt is printed into stdout while the error is printed into stderr, so they might arrive in any order: await App.AssertOutputLineStartsWith(" ❔ Do you want to restart your app? Yes (y) / No (n) / Always (a) / Never (v)", failure: _ => false); + await App.WaitUntilOutputContains(MessageDescriptor.RestartNeededToApplyChanges); - App.AssertOutputContains(MessageDescriptor.RestartNeededToApplyChanges); App.AssertOutputContains($"❌ {programPath}(39,11): error ENC0023: Adding an abstract method or overriding an inherited method requires restarting the application."); App.Process.ClearOutput(); @@ -1259,9 +1260,10 @@ public async Task Aspire_BuildError_ManualRestart() serviceSourcePath, serviceSource.Replace("record WeatherForecast", "record WeatherForecast2")); + // the prompt is printed into stdout while the error is printed into stderr, so they might arrive in any order: await App.WaitForOutputLineContaining(" ❔ Do you want to restart these projects? Yes (y) / No (n) / Always (a) / Never (v)"); + await App.WaitUntilOutputContains(MessageDescriptor.RestartNeededToApplyChanges); - App.AssertOutputContains(MessageDescriptor.RestartNeededToApplyChanges); App.AssertOutputContains($"dotnet watch ❌ {serviceSourcePath}(40,1): error ENC0020: Renaming record 'WeatherForecast' requires restarting the application."); App.AssertOutputContains("dotnet watch ⌚ Affected projects:"); App.AssertOutputContains("dotnet watch ⌚ WatchAspire.ApiService");