-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[3.1.x] Fix dotnet.exe process recovery after abnormal exit in ANCM #17103
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
Changes from all commits
c6d2bec
65601dd
1646a04
3adda55
47d931d
1832c43
6e32ce5
41d6c3d
33d0192
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,55 @@ public async Task EnvVarInWebConfig_Invalid(TestVariant variant, string port) | |
Assert.Equal(HttpStatusCode.BadGateway, response.StatusCode); | ||
} | ||
|
||
[ConditionalTheory] | ||
[MemberData(nameof(TestVariants))] | ||
[RequiresNewShim] | ||
public async Task ShutdownMultipleTimesWorks(TestVariant variant) | ||
{ | ||
// Must publish to set env vars in web.config | ||
var deploymentParameters = Fixture.GetBaseDeploymentParameters(variant); | ||
|
||
var deploymentResult = await DeployAsync(deploymentParameters); | ||
|
||
// Shutdown once | ||
var response = await deploymentResult.HttpClient.GetAsync("/Shutdown"); | ||
|
||
// Wait for server to start again. | ||
int i; | ||
for (i = 0; i < 10; i++) | ||
{ | ||
// ANCM should eventually recover from being shutdown multiple times. | ||
response = await deploymentResult.HttpClient.GetAsync("/HelloWorld"); | ||
if (response.IsSuccessStatusCode) | ||
jkotalik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
break; | ||
} | ||
} | ||
|
||
if (i == 10) | ||
{ | ||
// Didn't restart after 10 retries | ||
Assert.False(true); | ||
} | ||
|
||
// Shutdown again | ||
response = await deploymentResult.HttpClient.GetAsync("/Shutdown"); | ||
jkotalik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// return if server starts again. | ||
for (i = 0; i < 10; i++) | ||
{ | ||
// ANCM should eventually recover from being shutdown multiple times. | ||
jkotalik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
response = await deploymentResult.HttpClient.GetAsync("/HelloWorld"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Still not a fan 😆 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the problem here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test is a bit... ugly. |
||
if (response.IsSuccessStatusCode) | ||
{ | ||
return; | ||
} | ||
} | ||
|
||
// Test failure if this happens. | ||
Assert.False(true); | ||
} | ||
|
||
private static int GetUnusedRandomPort() | ||
{ | ||
// Large number of retries to prevent test failures due to port collisions, but not infinite | ||
|
Uh oh!
There was an error while loading. Please reload this page.