Update some tests to be flaky rather than skipped (#8666)
This commit is contained in:
parent
9db249e30a
commit
2d145682ce
|
|
@ -212,15 +212,22 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
|
||||||
await AssertRunning(deploymentResult);
|
await AssertRunning(deploymentResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory(Skip = "https://github.com/aspnet/AspNetCore/issues/7075")]
|
[ConditionalTheory]
|
||||||
[InlineData(HostingModel.InProcess)]
|
[InlineData(HostingModel.InProcess)]
|
||||||
[InlineData(HostingModel.OutOfProcess)]
|
[InlineData(HostingModel.OutOfProcess)]
|
||||||
|
[Flaky("https://github.com/aspnet/AspNetCore/issues/7075")]
|
||||||
public async Task AppOfflineAddedAndRemovedStress(HostingModel hostingModel)
|
public async Task AppOfflineAddedAndRemovedStress(HostingModel hostingModel)
|
||||||
{
|
{
|
||||||
var deploymentResult = await AssertStarts(hostingModel);
|
var deploymentResult = await AssertStarts(hostingModel);
|
||||||
|
|
||||||
var load = Helpers.StressLoad(deploymentResult.HttpClient, "/HelloWorld", response => {
|
var load = Helpers.StressLoad(deploymentResult.HttpClient, "/HelloWorld", response => {
|
||||||
var statusCode = (int)response.StatusCode;
|
var statusCode = (int)response.StatusCode;
|
||||||
|
// Test failure involves the stress load receiving a 400 Bad Request.
|
||||||
|
// We think it is due to IIS returning the 400 itself, but need to confirm the hypothesis.
|
||||||
|
if (statusCode == 400)
|
||||||
|
{
|
||||||
|
Logger.LogError($"Status code was a bad request. Content: {response.Content.ReadAsStringAsync().GetAwaiter().GetResult()}");
|
||||||
|
}
|
||||||
Assert.True(statusCode == 200 || statusCode == 503, "Status code was " + statusCode);
|
Assert.True(statusCode == 200 || statusCode == 503, "Status code was " + statusCode);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,9 +78,10 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.CouldNotFindHandler(), Logger);
|
EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.CouldNotFindHandler(), Logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory(Skip = "https://github.com/aspnet/AspNetCore-Internal/issues/1794")]
|
[ConditionalTheory]
|
||||||
[InlineData(HostingModel.InProcess)]
|
[InlineData(HostingModel.InProcess)]
|
||||||
[InlineData(HostingModel.OutOfProcess)]
|
[InlineData(HostingModel.OutOfProcess)]
|
||||||
|
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/1794")]
|
||||||
public async Task ConfigurationTouchedStress(HostingModel hostingModel)
|
public async Task ConfigurationTouchedStress(HostingModel hostingModel)
|
||||||
{
|
{
|
||||||
var deploymentResult = await DeployAsync(Fixture.GetBaseDeploymentParameters(hostingModel));
|
var deploymentResult = await DeployAsync(Fixture.GetBaseDeploymentParameters(hostingModel));
|
||||||
|
|
|
||||||
|
|
@ -318,24 +318,31 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact(Skip = "https://github.com/aspnet/AspNetCore-Internal/issues/1772")]
|
[ConditionalFact]
|
||||||
|
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/1772")]
|
||||||
public async Task StartupTimeoutIsApplied()
|
public async Task StartupTimeoutIsApplied()
|
||||||
{
|
{
|
||||||
var deploymentParameters = Fixture.GetBaseDeploymentParameters(Fixture.InProcessTestSite);
|
// From what I can tell, this failure is due to ungraceful shutdown.
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} Hang");
|
// The error could be the same as https://github.com/dotnet/core-setup/issues/4646
|
||||||
deploymentParameters.WebConfigActionList.Add(
|
// But can't be certain without another repro.
|
||||||
WebConfigHelpers.AddOrModifyAspNetCoreSection("startupTimeLimit", "1"));
|
using (AppVerifier.Disable(DeployerSelector.ServerType, 0x300))
|
||||||
|
{
|
||||||
|
var deploymentParameters = Fixture.GetBaseDeploymentParameters(Fixture.InProcessTestSite);
|
||||||
|
deploymentParameters.TransformArguments((a, _) => $"{a} Hang");
|
||||||
|
deploymentParameters.WebConfigActionList.Add(
|
||||||
|
WebConfigHelpers.AddOrModifyAspNetCoreSection("startupTimeLimit", "1"));
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
var response = await deploymentResult.HttpClient.GetAsync("/");
|
var response = await deploymentResult.HttpClient.GetAsync("/");
|
||||||
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
|
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
|
||||||
|
|
||||||
StopServer();
|
StopServer();
|
||||||
|
|
||||||
EventLogHelpers.VerifyEventLogEvents(deploymentResult,
|
EventLogHelpers.VerifyEventLogEvents(deploymentResult,
|
||||||
EventLogHelpers.InProcessFailedToStart(deploymentResult, "Managed server didn't initialize after 1000 ms.")
|
EventLogHelpers.InProcessFailedToStart(deploymentResult, "Managed server didn't initialize after 1000 ms.")
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,8 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
AssertConnectionDisconnectLog();
|
AssertConnectionDisconnectLog();
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact(Skip = "https://github.com/aspnet/AspNetCore-Internal/issues/1831")]
|
[ConditionalFact]
|
||||||
|
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/1831")]
|
||||||
public async Task WritesCancelledWhenUsingAbortedToken()
|
public async Task WritesCancelledWhenUsingAbortedToken()
|
||||||
{
|
{
|
||||||
var requestStartedCompletionSource = CreateTaskCompletionSource();
|
var requestStartedCompletionSource = CreateTaskCompletionSource();
|
||||||
|
|
@ -172,7 +173,8 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact(Skip = "https://github.com/aspnet/AspNetCore-Internal/issues/1831")]
|
[ConditionalFact]
|
||||||
|
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/1831")]
|
||||||
public async Task ReaderThrowsCancelledException()
|
public async Task ReaderThrowsCancelledException()
|
||||||
{
|
{
|
||||||
var requestStartedCompletionSource = CreateTaskCompletionSource();
|
var requestStartedCompletionSource = CreateTaskCompletionSource();
|
||||||
|
|
@ -217,7 +219,8 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact(Skip = "https://github.com/aspnet/AspNetCore-Internal/issues/1817")]
|
[ConditionalFact]
|
||||||
|
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/1817")]
|
||||||
public async Task ReaderThrowsResetExceptionOnInvalidBody()
|
public async Task ReaderThrowsResetExceptionOnInvalidBody()
|
||||||
{
|
{
|
||||||
var requestStartedCompletionSource = CreateTaskCompletionSource();
|
var requestStartedCompletionSource = CreateTaskCompletionSource();
|
||||||
|
|
@ -237,7 +240,6 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
{
|
{
|
||||||
exception = e;
|
exception = e;
|
||||||
}
|
}
|
||||||
|
|
||||||
requestCompletedCompletionSource.SetResult(true);
|
requestCompletedCompletionSource.SetResult(true);
|
||||||
}, LoggerFactory))
|
}, LoggerFactory))
|
||||||
{
|
{
|
||||||
|
|
@ -269,6 +271,46 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
AssertConnectionDisconnectLog();
|
AssertConnectionDisconnectLog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ConditionalFact]
|
||||||
|
public async Task ReadsAlwaysGoAsync()
|
||||||
|
{
|
||||||
|
// A hypothesis on why there are flaky tests is due to read async not going
|
||||||
|
// async. Adding a test that confirms ReadAsync is async.
|
||||||
|
for (var i = 0; i < 10; i++)
|
||||||
|
{
|
||||||
|
var requestStartedCompletionSource = CreateTaskCompletionSource();
|
||||||
|
var requestCompletedCompletionSource = CreateTaskCompletionSource();
|
||||||
|
|
||||||
|
var data = new byte[1024];
|
||||||
|
using (var testServer = await TestServer.Create(async ctx =>
|
||||||
|
{
|
||||||
|
var task = ctx.Request.Body.ReadAsync(data);
|
||||||
|
Assert.True(!task.IsCompleted);
|
||||||
|
requestStartedCompletionSource.SetResult(true);
|
||||||
|
await task;
|
||||||
|
|
||||||
|
requestCompletedCompletionSource.SetResult(true);
|
||||||
|
}, LoggerFactory))
|
||||||
|
{
|
||||||
|
using (var connection = testServer.CreateConnection())
|
||||||
|
{
|
||||||
|
await SendContentLength1Post(connection);
|
||||||
|
|
||||||
|
await requestStartedCompletionSource.Task;
|
||||||
|
await connection.Send(
|
||||||
|
"a");
|
||||||
|
|
||||||
|
await connection.Receive(
|
||||||
|
"HTTP/1.1 200 OK",
|
||||||
|
""
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
await requestCompletedCompletionSource.Task.DefaultTimeout();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task RequestAbortedIsTrippedWithoutIO()
|
public async Task RequestAbortedIsTrippedWithoutIO()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue