-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix IIS recycle regressions #59998
base: main
Are you sure you want to change the base?
Fix IIS recycle regressions #59998
Conversation
@@ -51,7 +51,7 @@ internal IISTestSiteFixture(Action<IISDeploymentParameters> configure) | |||
//DeploymentParameters.EnvironmentVariables.Add("ASPNETCORE_MODULE_DEBUG", "console"); | |||
|
|||
// This queue does not have websockets enabled currently, adding the module will break all tests using this fixture. | |||
if (!HelixHelper.GetTargetHelixQueue().ToLowerInvariant().Contains("windows.amd64.server2022")) | |||
if (!(HelixHelper.GetTargetHelixQueue() ?? "").ToLowerInvariant().Contains("windows.amd64.server2022")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix local websocket tests.
<logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" /> | ||
<traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" /> | ||
<logFile logFormat="W3C" directory="%TEMP%\IISTests\Logs" /> | ||
<traceFailedRequestsLogging directory="%TEMP%\IISTests\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Write logs to temp instead of user directory. If you know, you know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 5 out of 19 changed files in this pull request and generated no comments.
Files not reviewed (14)
- src/Servers/IIS/AspNetCoreModuleV2/AspNetCore/applicationmanager.cpp: Language not supported
- src/Servers/IIS/AspNetCoreModuleV2/AspNetCore/applicationmanager.h: Language not supported
- src/Servers/IIS/AspNetCoreModuleV2/AspNetCore/globalmodule.cpp: Language not supported
- src/Servers/IIS/IntegrationTesting.IIS/src/Http.SubApp.config: Language not supported
- src/Servers/IIS/IntegrationTesting.IIS/src/Http.config: Language not supported
- src/Servers/IIS/IIS/test/IISExpress.FunctionalTests/OutOfProcess/MultipleAppTests.cs: Evaluated as low risk
- src/Servers/IIS/IntegrationTesting.IIS/src/IISDeploymentParameterExtensions.cs: Evaluated as low risk
- src/Servers/IIS/IIS/test/Common.FunctionalTests/RequestResponseTests.cs: Evaluated as low risk
- src/Servers/IIS/IIS/test/Common.LongTests/StartupTests.cs: Evaluated as low risk
- src/Servers/IIS/IIS/test/Common.FunctionalTests/Infrastructure/EventLogHelpers.cs: Evaluated as low risk
- src/Servers/IIS/IIS/test/Common.FunctionalTests/Infrastructure/IISTestSiteFixture.cs: Evaluated as low risk
- src/Servers/IIS/IntegrationTesting.IIS/src/IISDeployerBase.cs: Evaluated as low risk
- src/Servers/IIS/IntegrationTesting.IIS/src/IISExpressDeployer.cs: Evaluated as low risk
- src/Servers/IIS/IIS/test/Common.FunctionalTests/MultiApplicationTests.cs: Evaluated as low risk
Comments suppressed due to low confidence (2)
src/Servers/IIS/IIS/test/Common.FunctionalTests/Infrastructure/Helpers.cs:259
- Ensure that the change to select the last site element is covered by tests.
.Elements("site").Last();
src/Servers/IIS/IntegrationTesting.IIS/src/IISDeployer.cs:34
- The variable
_siteId
is incremented without any checks or resets. This could potentially lead to an overflow if the application runs for a very long time and many sites are created. Consider adding a check to reset or handle the overflow scenario.
private int _siteId = 2;
@@ -161,18 +161,18 @@ public static string InProcessStarted(IISDeploymentResult deploymentResult) | |||
|
|||
public static string OutOfProcessStarted(IISDeploymentResult deploymentResult) | |||
{ | |||
return $"Application '/LM/W3SVC/1/ROOT' started process '\\d+' successfully and process '\\d+' is listening on port '\\d+'."; | |||
return $"Application '/LM/W3SVC/\\d+/ROOT' started process '\\d+' successfully and process '\\d+' is listening on port '\\d+'."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we loosening from strictly matching on 1
to any digit here? I see there are other updates related to multi-site handling in this PR. Does that address the regression or is it a new feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multi-site handling was added to add test coverage for the regression. Technically we might be able to pass in the site id to these methods so it's not using regex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursory LGTM!
Fixes #58939 and both issues mentioned in #54531, both the empty path issue described in the initial post and the bad shutdown mentioned in #54531 (comment)
These were regressed by #52807
The two regressions were:
disallowRotationOnConfigChange
wastrue
we would still shutdown the application on config changes.The third fix wasn't a regression but was simple enough to fix and part of one of the issues linked above so included a fix for it. Our usage of
_wcsicmp
didn't properly check the path started with"MACHINE/WEBROOT"
, it would pass for""
, or"MAC"
,"MACHINE/W"
, etc.We have the test
ConfigurationChangeCanBeIgnoredInProcess
which should have caught one of the regressions, but since it was testing for the lack of app shutdown it doesn't have any way to know that nothing happened, fixed the test to have a bit of a delay so it has a better chance of failing in the future if we regress this.We also have a multiple application test, but it was only running for IISExpress and it didn't have a restart scenario. Moved the test to the common tests so it's run by IIS as well and added a scenario where 1 of the applications restarts but the others don't.