From 76b4df01c5ee3df387796a59d3431f7bbd2b2f70 Mon Sep 17 00:00:00 2001 From: Brennan Date: Fri, 14 Feb 2025 15:54:15 -0800 Subject: [PATCH 1/4] Update IISHttpServer.cs --- src/Servers/IIS/IIS/src/Core/IISHttpServer.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Servers/IIS/IIS/src/Core/IISHttpServer.cs b/src/Servers/IIS/IIS/src/Core/IISHttpServer.cs index 68a634ebb21e..6abaa5b2c0db 100644 --- a/src/Servers/IIS/IIS/src/Core/IISHttpServer.cs +++ b/src/Servers/IIS/IIS/src/Core/IISHttpServer.cs @@ -28,7 +28,7 @@ internal sealed class IISHttpServer : IServer private readonly IISServerOptions _options; private readonly IISNativeApplication _nativeApplication; private readonly ServerAddressesFeature _serverAddressesFeature; - private readonly string? _virtualPath; + private string? _virtualPath; private readonly TaskCompletionSource _shutdownSignal = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); private bool? _websocketAvailable; @@ -69,8 +69,6 @@ ILogger logger _logger = logger; _options = options.Value; _serverAddressesFeature = new ServerAddressesFeature(); - var iisConfigData = NativeMethods.HttpGetApplicationProperties(); - _virtualPath = iisConfigData.pwzVirtualApplicationPath; if (_options.ForwardWindowsAuthentication) { @@ -106,6 +104,9 @@ public unsafe Task StartAsync(IHttpApplication application, (IntPtr)_httpServerHandle, (IntPtr)_httpServerHandle); + var iisConfigData = NativeMethods.HttpGetApplicationProperties(); + _virtualPath = iisConfigData.pwzVirtualApplicationPath; + _serverAddressesFeature.Addresses = _options.ServerAddresses; return Task.CompletedTask; From e4d8e3728e7994e42d29ba7eea476840d650a25b Mon Sep 17 00:00:00 2001 From: Brennan Date: Fri, 14 Feb 2025 15:55:06 -0800 Subject: [PATCH 2/4] Update AppOfflineIISExpressTests.cs --- .../InProcess/AppOfflineIISExpressTests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Servers/IIS/IIS/test/IISExpress.FunctionalTests/InProcess/AppOfflineIISExpressTests.cs b/src/Servers/IIS/IIS/test/IISExpress.FunctionalTests/InProcess/AppOfflineIISExpressTests.cs index 6bc3892713a4..d646b55104fc 100644 --- a/src/Servers/IIS/IIS/test/IISExpress.FunctionalTests/InProcess/AppOfflineIISExpressTests.cs +++ b/src/Servers/IIS/IIS/test/IISExpress.FunctionalTests/InProcess/AppOfflineIISExpressTests.cs @@ -19,6 +19,7 @@ public AppOfflineIISExpressTests(PublishedSitesFixture fixture) : base(fixture) } [ConditionalFact] + [Repeat(100)] public async Task AppOfflineDroppedWhileSiteStarting_SiteShutsDown_InProcess() { // This test often hits a race between debug logging and stdout redirection closing the handle From deb1a3cb7b02bba82462aec2e9f5c99f71856856 Mon Sep 17 00:00:00 2001 From: Brennan Date: Tue, 18 Feb 2025 11:01:48 -0800 Subject: [PATCH 3/4] wait for stop before log assert --- .../InProcess/AppOfflineIISExpressTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Servers/IIS/IIS/test/IISExpress.FunctionalTests/InProcess/AppOfflineIISExpressTests.cs b/src/Servers/IIS/IIS/test/IISExpress.FunctionalTests/InProcess/AppOfflineIISExpressTests.cs index d646b55104fc..d03e5c054726 100644 --- a/src/Servers/IIS/IIS/test/IISExpress.FunctionalTests/InProcess/AppOfflineIISExpressTests.cs +++ b/src/Servers/IIS/IIS/test/IISExpress.FunctionalTests/InProcess/AppOfflineIISExpressTests.cs @@ -56,8 +56,8 @@ public async Task AppOfflineDroppedWhileSiteStarting_SiteShutsDown_InProcess() { // For IISExpress, we need to catch the exception because IISExpress will not restart a process if it crashed. // RemoveAppOffline will fail due to a bad request exception as the server is down. - Assert.Contains(TestSink.Writes, context => context.Message.Contains("Drained all requests, notifying managed.")); deploymentResult.AssertWorkerProcessStop(); + Assert.Contains(TestSink.Writes, context => context.Message.Contains("Drained all requests, notifying managed.")); return; } } From 56584b1cd89cb13554a7124d6e01695c718b655a Mon Sep 17 00:00:00 2001 From: Brennan Date: Tue, 18 Feb 2025 15:58:42 -0800 Subject: [PATCH 4/4] Mark test as quarantined with issue link --- .../InProcess/AppOfflineIISExpressTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Servers/IIS/IIS/test/IISExpress.FunctionalTests/InProcess/AppOfflineIISExpressTests.cs b/src/Servers/IIS/IIS/test/IISExpress.FunctionalTests/InProcess/AppOfflineIISExpressTests.cs index d03e5c054726..db38cdf0ccb3 100644 --- a/src/Servers/IIS/IIS/test/IISExpress.FunctionalTests/InProcess/AppOfflineIISExpressTests.cs +++ b/src/Servers/IIS/IIS/test/IISExpress.FunctionalTests/InProcess/AppOfflineIISExpressTests.cs @@ -19,7 +19,7 @@ public AppOfflineIISExpressTests(PublishedSitesFixture fixture) : base(fixture) } [ConditionalFact] - [Repeat(100)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/60482")] public async Task AppOfflineDroppedWhileSiteStarting_SiteShutsDown_InProcess() { // This test often hits a race between debug logging and stdout redirection closing the handle