Skip to content
This repository was archived by the owner on Nov 1, 2018. It is now read-only.

Commit b08b237

Browse files
authored
StopServer before asserting TestSink (#1416)
1 parent 375d037 commit b08b237

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

test/IISExpress.FunctionalTests/InProcess/StartupTests.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ public async Task StartsWithDotnetOnThePath(string path)
9797
var deploymentResult = await DeployAsync(deploymentParameters);
9898
await deploymentResult.AssertStarts();
9999

100+
StopServer();
100101
// Verify that in this scenario where.exe was invoked only once by shim and request handler uses cached value
101102
Assert.Equal(1, TestSink.Writes.Count(w => w.Message.Contains("Invoking where.exe to find dotnet.exe")));
102103
}
@@ -143,7 +144,7 @@ public async Task DetectsOverriddenServer()
143144
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
144145

145146
StopServer();
146-
147+
147148
EventLogHelpers.VerifyEventLogEvents(deploymentResult,
148149
EventLogHelpers.InProcessFailedToStart(deploymentResult, "CLR worker thread exited prematurely"),
149150
EventLogHelpers.InProcessThreadException(deploymentResult, ".*?Application is running inside IIS process but is not configured to use IIS server"));
@@ -154,7 +155,7 @@ public async Task LogsStartupExceptionExitError()
154155
{
155156
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
156157
deploymentParameters.TransformArguments((a, _) => $"{a} Throw");
157-
158+
158159
var deploymentResult = await DeployAsync(deploymentParameters);
159160

160161
var response = await deploymentResult.HttpClient.GetAsync("/");
@@ -166,7 +167,7 @@ public async Task LogsStartupExceptionExitError()
166167
EventLogHelpers.InProcessFailedToStart(deploymentResult, "CLR worker thread exited prematurely"),
167168
EventLogHelpers.InProcessThreadException(deploymentResult, ", exception code = '0xe0434352'"));
168169
}
169-
170+
170171
[ConditionalFact]
171172
public async Task LogsUnexpectedThreadExitError()
172173
{
@@ -193,7 +194,7 @@ public async Task StartupTimeoutIsApplied()
193194
WebConfigHelpers.AddOrModifyAspNetCoreSection("startupTimeLimit", "1"));
194195

195196
var deploymentResult = await DeployAsync(deploymentParameters);
196-
197+
197198
var response = await deploymentResult.HttpClient.GetAsync("/");
198199
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
199200

@@ -213,7 +214,7 @@ public async Task ShutdownTimeoutIsApplied()
213214
WebConfigHelpers.AddOrModifyAspNetCoreSection("shutdownTimeLimit", "1"));
214215

215216
var deploymentResult = await DeployAsync(deploymentParameters);
216-
217+
217218
Assert.Equal("Hello World", await deploymentResult.HttpClient.GetStringAsync("/HelloWorld"));
218219

219220
StopServer();

test/IISExpress.FunctionalTests/OutOfProcess/GlobalVersionTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ private string GetANCMRequestHandlerPath(IISDeploymentResult deploymentResult, s
184184

185185
private void AssertLoadedVersion(string version)
186186
{
187+
StopServer();
187188
Assert.Contains(TestSink.Writes, context => context.Message.Contains(version + @"\aspnetcorev2_outofprocess.dll"));
188189
}
189190

0 commit comments

Comments
 (0)