diff --git a/src/Servers/IIS/IIS/test/Common.LongTests/ShutdownTests.cs b/src/Servers/IIS/IIS/test/Common.LongTests/ShutdownTests.cs index 4bfc8fb5f242..bcab0699348c 100644 --- a/src/Servers/IIS/IIS/test/Common.LongTests/ShutdownTests.cs +++ b/src/Servers/IIS/IIS/test/Common.LongTests/ShutdownTests.cs @@ -471,9 +471,13 @@ public async Task ConfigurationChangeForcesChildProcessRestart() // Just "touching" web.config should be enough deploymentResult.ModifyWebConfig(element => { }); - // Have to retry here to allow ANCM to receive notification and react to it - // Verify that worker process gets restarted with new process id - await deploymentResult.HttpClient.RetryRequestAsync("/ProcessId", async r => await r.Content.ReadAsStringAsync() != processBefore); + // Requests can be interrupted while ANCM replaces the worker, so retry both + // transient request failures and responses from the original process. + await Helpers.Retry(async () => + { + var processAfter = await deploymentResult.HttpClient.GetStringAsync("/ProcessId"); + Assert.NotEqual(processBefore, processAfter); + }, TimeSpan.FromSeconds(10)); } [ConditionalFact]