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

Diabling async TestHost.Tests on Mono #507 #508

Merged
merged 1 commit into from
Dec 3, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions test/Microsoft.AspNet.TestHost.Tests/ClientHandlerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public Task SingleSlashNotMovedToPathBase()
return httpClient.GetAsync("https://example.com/");
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task ResubmitRequestWorks()
{
int requestCount = 1;
Expand All @@ -83,7 +84,8 @@ public async Task ResubmitRequestWorks()
Assert.Equal("TestValue:2", response.Headers.GetValues("TestHeader").First());
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task MiddlewareOnlySetsHeaders()
{
var handler = new ClientHandler(PathString.Empty, new DummyApplication(context =>
Expand All @@ -96,7 +98,8 @@ public async Task MiddlewareOnlySetsHeaders()
Assert.Equal("TestValue", response.Headers.GetValues("TestHeader").First());
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task BlockingMiddlewareShouldNotBlockClient()
{
ManualResetEvent block = new ManualResetEvent(false);
Expand All @@ -113,7 +116,8 @@ public async Task BlockingMiddlewareShouldNotBlockClient()
HttpResponseMessage response = await task;
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task HeadersAvailableBeforeBodyFinished()
{
ManualResetEvent block = new ManualResetEvent(false);
Expand All @@ -132,7 +136,8 @@ public async Task HeadersAvailableBeforeBodyFinished()
Assert.Equal("BodyStarted,BodyFinished", await response.Content.ReadAsStringAsync());
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task FlushSendsHeaders()
{
ManualResetEvent block = new ManualResetEvent(false);
Expand All @@ -151,7 +156,8 @@ public async Task FlushSendsHeaders()
Assert.Equal("BodyFinished", await response.Content.ReadAsStringAsync());
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task ClientDisposalCloses()
{
ManualResetEvent block = new ManualResetEvent(false);
Expand All @@ -176,7 +182,8 @@ public async Task ClientDisposalCloses()
block.Set();
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task ClientCancellationAborts()
{
ManualResetEvent block = new ManualResetEvent(false);
Expand Down Expand Up @@ -215,7 +222,7 @@ public Task ExceptionBeforeFirstWriteIsReported()
}

[ConditionalFact]
[OSSkipCondition(OperatingSystems.Linux, SkipReason = "Hangs randomly (issue #422).")]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task ExceptionAfterFirstWriteIsReported()
{
ManualResetEvent block = new ManualResetEvent(false);
Expand Down
29 changes: 19 additions & 10 deletions test/Microsoft.AspNet.TestHost.Tests/TestClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ public TestClientTests()
_server = TestServer.Create(app => app.Run(ctx => Task.FromResult(0)));
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task GetAsyncWorks()
{
// Arrange
Expand All @@ -42,7 +43,8 @@ public async Task GetAsyncWorks()
Assert.Equal(expected, actual);
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task NoTrailingSlash_NoPathBase()
{
// Arrange
Expand All @@ -63,7 +65,8 @@ public async Task NoTrailingSlash_NoPathBase()
Assert.Equal(expected, actual);
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task SingleTrailingSlash_NoPathBase()
{
// Arrange
Expand All @@ -84,7 +87,8 @@ public async Task SingleTrailingSlash_NoPathBase()
Assert.Equal(expected, actual);
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task PutAsyncWorks()
{
// Arrange
Expand All @@ -101,7 +105,8 @@ public async Task PutAsyncWorks()
Assert.Equal("Hello world PUT Response", await response.Content.ReadAsStringAsync());
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task PostAsyncWorks()
{
// Arrange
Expand All @@ -118,7 +123,8 @@ public async Task PostAsyncWorks()
Assert.Equal("Hello world POST Response", await response.Content.ReadAsStringAsync());
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task WebSocketWorks()
{
// Arrange
Expand Down Expand Up @@ -179,7 +185,8 @@ public async Task WebSocketWorks()
clientSocket.Dispose();
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task WebSocketDisposalThrowsOnPeer()
{
// Arrange
Expand All @@ -205,7 +212,8 @@ public async Task WebSocketDisposalThrowsOnPeer()
clientSocket.Dispose();
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task WebSocketTinyReceiveGeneratesEndOfMessage()
{
// Arrange
Expand Down Expand Up @@ -248,7 +256,8 @@ public async Task WebSocketTinyReceiveGeneratesEndOfMessage()
clientSocket.Dispose();
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task ClientDisposalAbortsRequest()
{
// Arrange
Expand Down Expand Up @@ -282,7 +291,7 @@ public async Task ClientDisposalAbortsRequest()
}

[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.CoreCLR, SkipReason = "Hangs randomly (issue #422).")]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task ClientCancellationAbortsRequest()
{
// Arrange
Expand Down
52 changes: 34 additions & 18 deletions test/Microsoft.AspNet.TestHost.Tests/TestServerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public void CreateWithDelegate()
TestServer.Create(app => { });
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task RequestServicesAutoCreated()
{
var server = TestServer.Create(app =>
Expand Down Expand Up @@ -66,7 +67,8 @@ public void Configure(IApplicationBuilder app)

}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task CustomServiceProviderSetsApplicationServices()
{
var server = new TestServer(TestServer.CreateBuilder().UseStartup<CustomContainerStartup>());
Expand Down Expand Up @@ -107,7 +109,8 @@ public Action<IApplicationBuilder> Configure(Action<IApplicationBuilder> next)
}
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task ExistingRequestServicesWillNotBeReplaced()
{
var server = TestServer.Create(app =>
Expand All @@ -123,7 +126,8 @@ public async Task ExistingRequestServicesWillNotBeReplaced()
Assert.Equal("Found:True", result);
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task CanSetCustomServiceProvider()
{
var server = TestServer.Create(app =>
Expand Down Expand Up @@ -169,7 +173,8 @@ public Action<IApplicationBuilder> Configure(Action<IApplicationBuilder> next)
}
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task ExistingServiceProviderFeatureWillNotBeReplaced()
{
var appServices = new ServiceCollection().BuildServiceProvider();
Expand Down Expand Up @@ -206,7 +211,8 @@ public Action<IApplicationBuilder> Configure(Action<IApplicationBuilder> next)
}
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task WillReplaceServiceProviderFeatureWithNullRequestServices()
{
var server = TestServer.Create(app =>
Expand All @@ -222,7 +228,8 @@ public async Task WillReplaceServiceProviderFeatureWithNullRequestServices()
Assert.Equal("Success", result);
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task CanAccessLogger()
{
var server = TestServer.Create(app =>
Expand All @@ -238,7 +245,8 @@ public async Task CanAccessLogger()
Assert.Equal("FoundLogger:True", result);
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task CanAccessHttpContext()
{
Action<IServiceCollection> configureServices = services =>
Expand Down Expand Up @@ -268,7 +276,8 @@ public ContextHolder(IHttpContextAccessor accessor)
public IHttpContextAccessor Accessor { get; set; }
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task CanAddNewHostServices()
{
Action<IServiceCollection> configureServices = services =>
Expand All @@ -289,7 +298,8 @@ public async Task CanAddNewHostServices()
Assert.Equal("HasContext:True", result);
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task CreateInvokesApp()
{
TestServer server = TestServer.Create(app =>
Expand All @@ -304,7 +314,8 @@ public async Task CreateInvokesApp()
Assert.Equal("CreateInvokesApp", result);
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task DisposeStreamIgnored()
{
TestServer server = TestServer.Create(app =>
Expand All @@ -321,7 +332,8 @@ public async Task DisposeStreamIgnored()
Assert.Equal("Response", await result.Content.ReadAsStringAsync());
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task DisposedServerThrows()
{
TestServer server = TestServer.Create(app =>
Expand All @@ -340,7 +352,7 @@ public async Task DisposedServerThrows()
}

[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.CoreCLR, SkipReason = "Hangs randomly (issue #422).")]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public void CancelAborts()
{
TestServer server = TestServer.Create(app =>
Expand All @@ -356,7 +368,8 @@ public void CancelAborts()
Assert.Throws<AggregateException>(() => { string result = server.CreateClient().GetStringAsync("/path").Result; });
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task CanCreateViaStartupType()
{
TestServer server = new TestServer(TestServer.CreateBuilder().UseStartup<TestStartup>());
Expand All @@ -365,7 +378,8 @@ public async Task CanCreateViaStartupType()
Assert.Equal("FoundService:True", await result.Content.ReadAsStringAsync());
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task CanCreateViaStartupTypeAndSpecifyEnv()
{
TestServer server = new TestServer(TestServer.CreateBuilder()
Expand All @@ -375,8 +389,9 @@ public async Task CanCreateViaStartupTypeAndSpecifyEnv()
Assert.Equal(HttpStatusCode.OK, result.StatusCode);
Assert.Equal("FoundFoo:False", await result.Content.ReadAsStringAsync());
}

[Fact]

[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task BeginEndDiagnosticAvailable()
{
DiagnosticListener diagnosticListener = null;
Expand All @@ -401,7 +416,8 @@ public async Task BeginEndDiagnosticAvailable()
Assert.Null(listener.UnhandledException);
}

[Fact]
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Hangs randomly (issue #507)")]
public async Task ExceptionDiagnosticAvailable()
{
DiagnosticListener diagnosticListener = null;
Expand Down