Skip to content
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

Mark tests flaky instead of skipped #8727

Merged
merged 5 commits into from
Mar 26, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/EventTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void PreventDefault_DotNotApplyByDefault()
}

[Fact]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/1987", FlakyOn.All)]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/1987", FlakyOn.AzP.Windows)]
public void InputEvent_RespondsOnKeystrokes()
{
MountTestComponent<InputEventComponent>();
Expand Down
3 changes: 2 additions & 1 deletion src/Hosting/test/FunctionalTests/ShutdownTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public async Task ShutdownTestRun()
await ExecuteShutdownTest(nameof(ShutdownTestRun), "Run");
}

[ConditionalFact(Skip = "https://github.com/aspnet/Hosting/issues/1214")]
[ConditionalFact]
[Flaky("https://github.com/aspnet/Hosting/issues/1214", FlakyOn.All)]
[OSSkipCondition(OperatingSystems.Windows)]
[OSSkipCondition(OperatingSystems.MacOSX)]
public async Task ShutdownTestWaitForShutdown()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,4 +292,4 @@ public override Task CanFindUsersViaUserQuerable()
=> Task.CompletedTask;

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,8 @@ public async Task OriginIsValidatedForWebSocketRequests(HttpStatusCode expectedC
}
}

[Fact(Skip = "https://github.com/aspnet/AspNetCore/issues/8187")]
[Fact]
[Flaky("https://github.com/aspnet/AspNetCore/issues/8187", FlakyOn.Helix.All)]
public async Task OriginIsNotValidatedForNonWebSocketRequests()
{
using (var server = KestrelWebSocketHelpers.CreateServer(LoggerFactory, out var port, context =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ public void CreateActionModel_RouteAttributeOnController_CreatesAttributeRoute_F
Assert.Empty(action.Attributes);
}

[Theory(Skip = "See aspnet/AspNetCore#4417")]
[Theory(Skip = "https://github.com/aspnet/AspNetCore/issues/4417")]
[InlineData(typeof(SingleRouteAttributeController))]
[InlineData(typeof(MultipleRouteAttributeController))]
public void CreateActionModel_RouteOnController_CreatesOneActionInfoPerRouteTemplateOnAction(Type controller)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public override Task ReadAsync_UsesTryAddModelValidationErrorsToModelState()
{
return base.ReadAsync_UsesTryAddModelValidationErrorsToModelState();
}

[Fact(Skip = "https://github.com/dotnet/corefx/issues/36026")]
public override Task ReadAsync_ReadsValidArray_AsCollectionOfT()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ public override Task JsonInputFormatter_ReturnsDefaultValue_ForValueTypes(string
return base.JsonInputFormatter_ReturnsDefaultValue_ForValueTypes(input);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Testing.xunit;
using Microsoft.Net.Http.Headers;
using Xunit;

Expand All @@ -28,7 +29,8 @@ public class TempDataInCookiesUsingCookieConsentTest
private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
builder.UseStartup<BasicWebSite.StartupWithCookieTempDataProviderAndCookieConsent>();

[Fact(Skip = "https://github.com/aspnet/AspNetCore-Internal/issues/1803")]
[Fact]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/1803", FlakyOn.AzP.Windows)]
public async Task CookieTempDataProviderCookie_SetInResponse_OnGrantingConsent()
{
// Arrange
Expand Down Expand Up @@ -61,7 +63,8 @@ public async Task CookieTempDataProviderCookie_SetInResponse_OnGrantingConsent()
Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
}

[Fact(Skip = "https://github.com/aspnet/AspNetCore-Internal/issues/1803")]
[Fact]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/1803", FlakyOn.AzP.Windows)]
public async Task CookieTempDataProviderCookie_NotSetInResponse_OnNoConsent()
{
// Arrange
Expand Down
13 changes: 0 additions & 13 deletions src/Mvc/test/Mvc.FunctionalTests/ViewEngineTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -464,19 +464,6 @@ public async Task ViewEngine_NormalizesPathsReturnedByViewLocationExpanders()
Assert.Equal(expected, responseContent, ignoreLineEndingDifferences: true);
}

[Fact(Skip = "https://github.com/aspnet/Mvc/issues/8754")]
public async Task ViewEngine_ResolvesPathsWithSlashesThatDoNotHaveExtensions()
{
// Arrange
var expected = @"<embdedded-layout>Hello from EmbeddedHome\EmbeddedPartial</embdedded-layout>";

// Act
var responseContent = await Client.GetStringAsync("/EmbeddedViews/RelativeNonPath");

// Assert
Assert.Equal(expected, responseContent.Trim());
}

[Fact]
public async Task ViewEngine_DiscoversViewsFromPagesSharedDirectory()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ public async Task AppOfflineAddedAndRemovedStress(HostingModel 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;
// 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public async Task ConfigurationChangeStopsInProcess()
await deploymentResult.AssertStarts();

// Just "touching" web.config should be enough
deploymentResult.ModifyWebConfig(element => {});
deploymentResult.ModifyWebConfig(element => { });

await deploymentResult.AssertRecycledAsync();
}
Expand All @@ -49,7 +49,7 @@ public async Task ConfigurationChangeForcesChildProcessRestart()
var processBefore = await deploymentResult.HttpClient.GetStringAsync("/ProcessId");

// Just "touching" web.config should be enough
deploymentResult.ModifyWebConfig(element => {});
deploymentResult.ModifyWebConfig(element => { });

// Have to retry here to allow ANCM to receive notification and react to it
// Verify that worker process gets restarted with new process id
Expand Down Expand Up @@ -88,7 +88,8 @@ public async Task ConfigurationTouchedStress(HostingModel hostingModel)
var deploymentResult = await DeployAsync(Fixture.GetBaseDeploymentParameters(hostingModel));

await deploymentResult.AssertStarts();
var load = Helpers.StressLoad(deploymentResult.HttpClient, "/HelloWorld", response => {
var load = Helpers.StressLoad(deploymentResult.HttpClient, "/HelloWorld", response =>
{
var statusCode = (int)response.StatusCode;
Assert.True(statusCode == 200 || statusCode == 503, "Status code was " + statusCode);
});
Expand All @@ -97,7 +98,7 @@ public async Task ConfigurationTouchedStress(HostingModel hostingModel)
{
// ModifyWebConfig might fail if web.config is being read by IIS
RetryHelper.RetryOperation(
() => deploymentResult.ModifyWebConfig(element => {}),
() => deploymentResult.ModifyWebConfig(element => { }),
e => Logger.LogError($"Failed to touch web.config : {e.Message}"),
retryCount: 3,
retryDelayMilliseconds: RetryDelay.Milliseconds);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,42 +430,48 @@ public async Task StartsWithWebConfigVariationsPortable(string scenario)
var pathWithSpace = "\u03c0 \u2260 3\u00b714";

dictionary.Add("App in bin subdirectory full path to dll using exec and quotes",
parameters => {
parameters =>
{
MoveApplication(parameters, "bin");
parameters.TransformArguments((arguments, root) => "exec " + Path.Combine(root, "bin", arguments));
return "";
});

dictionary.Add("App in subdirectory with space",
parameters => {
parameters =>
{
MoveApplication(parameters, pathWithSpace);
parameters.TransformArguments((arguments, root) => Path.Combine(pathWithSpace, arguments));
return "";
});

dictionary.Add("App in subdirectory with space and full path to dll",
parameters => {
parameters =>
{
MoveApplication(parameters, pathWithSpace);
parameters.TransformArguments((arguments, root) => Path.Combine(root, pathWithSpace, arguments));
return "";
});

dictionary.Add("App in bin subdirectory with space full path to dll using exec and quotes",
parameters => {
parameters =>
{
MoveApplication(parameters, pathWithSpace);
parameters.TransformArguments((arguments, root) => "exec \"" + Path.Combine(root, pathWithSpace, arguments) + "\" extra arguments");
return "extra|arguments";
});

dictionary.Add("App in bin subdirectory and quoted argument",
parameters => {
parameters =>
{
MoveApplication(parameters, "bin");
parameters.TransformArguments((arguments, root) => Path.Combine("bin", arguments) + " \"extra argument\"");
return "extra argument";
});

dictionary.Add("App in bin subdirectory full path to dll",
parameters => {
parameters =>
{
MoveApplication(parameters, "bin");
parameters.TransformArguments((arguments, root) => Path.Combine(root, "bin", arguments) + " extra arguments");
return "extra|arguments";
Expand Down Expand Up @@ -495,15 +501,17 @@ public async Task StartsWithWebConfigVariationsStandalone(string scenario)
var pathWithSpace = "\u03c0 \u2260 3\u00b714";

dictionary.Add("App in subdirectory",
parameters => {
parameters =>
{
MoveApplication(parameters, pathWithSpace);
parameters.TransformPath((path, root) => Path.Combine(pathWithSpace, path));
parameters.TransformArguments((arguments, root) => "\"additional argument\"");
return "additional argument";
});

dictionary.Add("App in bin subdirectory full path",
parameters => {
parameters =>
{
MoveApplication(parameters, pathWithSpace);
parameters.TransformPath((path, root) => Path.Combine(root, pathWithSpace, path));
parameters.TransformArguments((arguments, root) => "additional arguments");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public async Task HelloWorld(TestVariant variant)
{
var deploymentParameters = Fixture.GetBaseDeploymentParameters(variant);
deploymentParameters.ServerConfigActionList.Add(
(element, _) => {
(element, _) =>
{
element
.RequiredElement("system.webServer")
.RequiredElement("security")
Expand Down Expand Up @@ -68,7 +69,7 @@ public async Task HelloWorld(TestVariant variant)
Assert.Equal(deploymentResult.ContentRoot, await deploymentResult.HttpClient.GetStringAsync("/ContentRootPath"));
Assert.Equal(deploymentResult.ContentRoot + "\\wwwroot", await deploymentResult.HttpClient.GetStringAsync("/WebRootPath"));
var expectedDll = "aspnetcorev2.dll";
Assert.Contains(deploymentResult.HostProcess.Modules.OfType<ProcessModule>(), m=> m.FileName.Contains(expectedDll));
Assert.Contains(deploymentResult.HostProcess.Modules.OfType<ProcessModule>(), m => m.FileName.Contains(expectedDll));

if (DeployerSelector.HasNewHandler && variant.HostingModel == HostingModel.InProcess)
{
Expand Down
5 changes: 3 additions & 2 deletions src/Servers/IIS/IIS/test/IIS.Tests/ClientDisconnectTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public async Task ReaderThrowsCancelledException()
}

[ConditionalFact]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/1817", FlakyOn.All)]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/1817", FlakyOn.AzP.Windows)]
public async Task ReaderThrowsResetExceptionOnInvalidBody()
{
var requestStartedCompletionSource = CreateTaskCompletionSource();
Expand Down Expand Up @@ -319,7 +319,8 @@ public async Task RequestAbortedIsTrippedWithoutIO()
var requestAborted = CreateTaskCompletionSource();

using (var testServer = await TestServer.Create(
async ctx => {
async ctx =>
{
ctx.RequestAborted.Register(() => requestAborted.SetResult(true));
requestStarted.SetResult(true);
await requestAborted.Task;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ public static IEnumerable<object[]> LargeUploadData
private bool LargeUploadRetryPredicate(Exception e)
=> e is IOException && e.Message.Contains("Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request");

[Theory(Skip = "https://github.com/aspnet/AspNetCore/issues/8054")]
[Theory]
[Flaky("https://github.com/aspnet/AspNetCore/issues/8054", FlakyOn.AzP.Windows)]
[RetryTest(nameof(LargeUploadRetryPredicate),
"Active investigation into potential corefx sockets bug: https://github.com/dotnet/corefx/issues/30691",
OperatingSystems.Windows,
Expand Down
3 changes: 2 additions & 1 deletion src/Servers/Kestrel/test/FunctionalTests/ResponseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,8 @@ public async Task WritingToConnectionAfterUnobservedCloseTriggersRequestAbortedT
Assert.True(requestAborted.Task.IsCompleted);
}

[Theory(Skip = "https://github.com/aspnet/AspNetCore/issues/7342")]
[Theory]
[Flaky("https://github.com/aspnet/AspNetCore/issues/7342", FlakyOn.All)]
[MemberData(nameof(ConnectionAdapterData))]
public async Task AppCanHandleClientAbortingConnectionMidResponse(ListenOptions listenOptions)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public async Task HEADERS_NotReceivedAfterFirstRequest_WithinKeepAliveTimeout_Cl
public async Task HEADERS_ReceivedWithoutAllCONTINUATIONs_WithinRequestHeadersTimeout_AbortsConnection()
{
var mockSystemClock = _serviceContext.MockSystemClock;
var limits = _serviceContext.ServerOptions.Limits;;
var limits = _serviceContext.ServerOptions.Limits; ;
ryanbrandenburg marked this conversation as resolved.
Show resolved Hide resolved

_timeoutControl.Initialize(mockSystemClock.UtcNow.Ticks);

Expand All @@ -154,8 +154,8 @@ public async Task HEADERS_ReceivedWithoutAllCONTINUATIONs_WithinRequestHeadersTi
Http2ErrorCode.INTERNAL_ERROR,
CoreStrings.BadRequest_RequestHeadersTimeout);

_mockConnectionContext.Verify(c =>c.Abort(It.Is<ConnectionAbortedException>(e =>
e.Message == CoreStrings.BadRequest_RequestHeadersTimeout)), Times.Once);
_mockConnectionContext.Verify(c => c.Abort(It.Is<ConnectionAbortedException>(e =>
e.Message == CoreStrings.BadRequest_RequestHeadersTimeout)), Times.Once);

_mockTimeoutHandler.VerifyNoOtherCalls();
_mockConnectionContext.VerifyNoOtherCalls();
Expand All @@ -175,7 +175,7 @@ public async Task ResponseDrain_SlowerThanMinimumDataRate_AbortsConnection()

await WaitForConnectionStopAsync(expectedLastStreamId: 0, ignoreNonGoAwayFrames: false);

AdvanceClock(TimeSpan.FromSeconds(_bytesReceived / limits.MinResponseDataRate.BytesPerSecond) +
AdvanceClock(TimeSpan.FromSeconds(_bytesReceived / limits.MinResponseDataRate.BytesPerSecond) +
limits.MinResponseDataRate.GracePeriod + Heartbeat.Interval - TimeSpan.FromSeconds(.5));

_mockTimeoutHandler.Verify(h => h.OnTimeout(It.IsAny<TimeoutReason>()), Times.Never);
Expand All @@ -185,14 +185,15 @@ public async Task ResponseDrain_SlowerThanMinimumDataRate_AbortsConnection()

_mockTimeoutHandler.Verify(h => h.OnTimeout(TimeoutReason.WriteDataRate), Times.Once);

_mockConnectionContext.Verify(c =>c.Abort(It.Is<ConnectionAbortedException>(e =>
e.Message == CoreStrings.ConnectionTimedBecauseResponseMininumDataRateNotSatisfied)), Times.Once);
_mockConnectionContext.Verify(c => c.Abort(It.Is<ConnectionAbortedException>(e =>
e.Message == CoreStrings.ConnectionTimedBecauseResponseMininumDataRateNotSatisfied)), Times.Once);

_mockTimeoutHandler.VerifyNoOtherCalls();
_mockConnectionContext.VerifyNoOtherCalls();
}

[Theory(Skip = "https://github.com/aspnet/AspNetCore-Internal/issues/1879")]
[Theory]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/1879", FlakyOn.AzP.Linux)]
[InlineData((int)Http2FrameType.DATA)]
[InlineData((int)Http2FrameType.CONTINUATION)]
public async Task AbortedStream_ResetsAndDrainsRequest_RefusesFramesAfterCooldownExpires(int intFinalFrameType)
Expand Down Expand Up @@ -267,7 +268,7 @@ async Task AdvanceClockAndSendFrames()
}

[ConditionalFact]
[SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/7000
[SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/7000
public async Task DATA_Sent_TooSlowlyDueToSocketBackPressureOnSmallWrite_AbortsConnectionAfterGracePeriod()
{
var mockSystemClock = _serviceContext.MockSystemClock;
Expand All @@ -282,7 +283,7 @@ public async Task DATA_Sent_TooSlowlyDueToSocketBackPressureOnSmallWrite_AbortsC
_timeoutControl.Initialize(mockSystemClock.UtcNow.Ticks);

await InitializeConnectionAsync(_echoApplication);

await StartStreamAsync(1, _browserRequestHeaders, endStream: false);
await SendDataAsync(1, _helloWorldBytes, endStream: true);

Expand Down Expand Up @@ -316,8 +317,8 @@ public async Task DATA_Sent_TooSlowlyDueToSocketBackPressureOnSmallWrite_AbortsC
Http2ErrorCode.INTERNAL_ERROR,
null);

_mockConnectionContext.Verify(c =>c.Abort(It.Is<ConnectionAbortedException>(e =>
e.Message == CoreStrings.ConnectionTimedBecauseResponseMininumDataRateNotSatisfied)), Times.Once);
_mockConnectionContext.Verify(c => c.Abort(It.Is<ConnectionAbortedException>(e =>
e.Message == CoreStrings.ConnectionTimedBecauseResponseMininumDataRateNotSatisfied)), Times.Once);

_mockTimeoutHandler.VerifyNoOtherCalls();
_mockConnectionContext.VerifyNoOtherCalls();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,8 @@ public async Task DoesNotSupportTls10()
}
}

[Theory(Skip = "https://github.com/aspnet/AspNetCore/issues/7265")]
[Theory]
[Flaky("https://github.com/aspnet/AspNetCore/issues/7265", FlakyOn.All)]
[InlineData(ClientCertificateMode.AllowCertificate)]
[InlineData(ClientCertificateMode.RequireCertificate)]
public async Task ClientCertificateValidationGetsCalledWithNotNullParameters(ClientCertificateMode mode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2081,7 +2081,8 @@ public async Task LongPollingCanPollIfWritePipeHasBackpressure()
}
}

[Fact(Skip = "https://github.com/aspnet/AspNetCore/issues/8138")]
[Fact]
[Flaky("https://github.com/aspnet/AspNetCore/issues/8138", FlakyOn.All)]
public async Task ErrorDuringPollWillCloseConnection()
{
bool ExpectedErrors(WriteContext writeContext)
Expand Down