Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.
Closed
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
4 changes: 4 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="DotNetCore" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="DotNetCli" value="https://dotnet.myget.org/F/dotnet-cli/api/v3/index.json" />
<add key="AspNetVolatile" value="https://www.myget.org/F/aspnetvolatiledev/api/v3/index.json" />
<add key="AspNetVNext" value="https://www.myget.org/F/aspnetcidev/api/v3/index.json" />
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
</packageSources>
Expand Down
4 changes: 1 addition & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ build_script:
- build.cmd --quiet verify
clone_depth: 1
test: off
deploy: off
environment:
NO_PARALLEL_TEST_PROJECTS: Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
deploy: off
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ public Task StartAsync()

public void Stop(TimeSpan timeout)
{
if (_thread != null)
{
// Mark the thread as being as unimportant to keeping the app alive
// If it doesn't respond to the shutdown requests, the app will still stop.
_thread.IsBackground = true;
}

if (!_initCompleted)
{
return;
Expand All @@ -89,24 +96,18 @@ public void Stop(TimeSpan timeout)
if (!_thread.Join(stepTimeout))
{
Post(t => t.OnStopImmediate());
if (!_thread.Join(stepTimeout))
{
#if NET451
_thread.Abort();
#endif
}

// One last chance
_thread.Join(stepTimeout);
}
}
catch (ObjectDisposedException)
{
// REVIEW: Should we log something here?
// Until we rework this logic, ODEs are bound to happen sometimes.
if (!_thread.Join(stepTimeout))
{
#if NET451
_thread.Abort();
#endif
}

// One last chance
_thread.Join(stepTimeout);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.AspNetCore.Server.Kestrel/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"System.Diagnostics.Tracing": "4.1.0-*",
"System.Globalization": "4.0.11-*",
"System.IO": "4.1.0-*",
"System.Linq": "4.0.2-*",
"System.Linq": "4.1.0-*",
"System.Net.Primitives": "4.0.11-*",
"System.Runtime.Extensions": "4.1.0-*",
"System.Runtime.InteropServices": "4.1.0-*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
{
public class AddressRegistrationTests
{
[ConditionalTheory, MemberData(nameof(AddressRegistrationDataIPv4))]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on Mono.")]
[Theory, MemberData(nameof(AddressRegistrationDataIPv4))]
public async Task RegisterAddresses_IPv4_Success(string addressInput, string[] testUrls)
{
await RegisterAddresses_Success(addressInput, testUrls);
}

[ConditionalTheory, MemberData(nameof(AddressRegistrationDataIPv6))]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on Mono.")]
[IPv6SupportedCondition]
public async Task RegisterAddresses_IPv6_Success(string addressInput, string[] testUrls)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Testing.xunit;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
Expand All @@ -17,21 +16,20 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
{
public class PathBaseTests
{
[ConditionalTheory]
[Theory]
[InlineData("/base", "/base", "/base", "")]
[InlineData("/base", "/base/", "/base", "/")]
[InlineData("/base", "/base/something", "/base", "/something")]
[InlineData("/base", "/base/something/", "/base", "/something/")]
[InlineData("/base/more", "/base/more", "/base/more", "")]
[InlineData("/base/more", "/base/more/something", "/base/more", "/something")]
[InlineData("/base/more", "/base/more/something/", "/base/more", "/something/")]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on Mono.")]
public Task RequestPathBaseIsServerPathBase(string registerPathBase, string requestPath, string expectedPathBase, string expectedPath)
{
return TestPathBase(registerPathBase, requestPath, expectedPathBase, expectedPath);
}

[ConditionalTheory]
[Theory]
[InlineData("", "/", "", "/")]
[InlineData("", "/something", "", "/something")]
[InlineData("/", "/", "", "/")]
Expand All @@ -40,33 +38,29 @@ public Task RequestPathBaseIsServerPathBase(string registerPathBase, string requ
[InlineData("/base", "/baseandsomething", "", "/baseandsomething")]
[InlineData("/base", "/ba", "", "/ba")]
[InlineData("/base", "/ba/se", "", "/ba/se")]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on Mono.")]
public Task DefaultPathBaseIsEmpty(string registerPathBase, string requestPath, string expectedPathBase, string expectedPath)
{
return TestPathBase(registerPathBase, requestPath, expectedPathBase, expectedPath);
}

[ConditionalTheory]
[Theory]
[InlineData("", "/", "", "/")]
[InlineData("/", "/", "", "/")]
[InlineData("/base", "/base/", "/base", "/")]
[InlineData("/base/", "/base", "/base", "")]
[InlineData("/base/", "/base/", "/base", "/")]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on Mono.")]
public Task PathBaseNeverEndsWithSlash(string registerPathBase, string requestPath, string expectedPathBase, string expectedPath)
{
return TestPathBase(registerPathBase, requestPath, expectedPathBase, expectedPath);
}

[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on Mono.")]
[Fact]
public Task PathBaseAndPathPreserveRequestCasing()
{
return TestPathBase("/base", "/Base/Something", "/Base", "/Something");
}

[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on Mono.")]
[Fact]
public Task PathBaseCanHaveUTF8Characters()
{
return TestPathBase("/b♫se", "/b♫se/something", "/b♫se", "/something");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
{
public class RequestTests
{
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on Mono.")]
[Fact]
public async Task LargeUpload()
{
var port = PortManager.GetPort();
Expand Down Expand Up @@ -78,25 +77,22 @@ public async Task LargeUpload()
}
}

[ConditionalTheory]
[Theory]
[InlineData("127.0.0.1", "127.0.0.1")]
[InlineData("localhost", "127.0.0.1")]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on Mono.")]
public Task RemoteIPv4Address(string requestAddress, string expectAddress)
{
return TestRemoteIPAddress("localhost", requestAddress, expectAddress);
}

[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on Mono.")]
[IPv6SupportedCondition]
public Task RemoteIPv6Address()
{
return TestRemoteIPAddress("[::1]", "[::1]", "::1");
}

[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on Mono.")]
[Fact]
public async Task DoesNotHangOnConnectionCloseRequest()
{
var port = PortManager.GetPort();
Expand Down Expand Up @@ -130,9 +126,8 @@ public async Task DoesNotHangOnConnectionCloseRequest()
}
}

[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on Mono.")]
public async Task RequestPathIsNormalized()
[Fact]
public void RequestPathIsNormalized()
{
var port = PortManager.GetPort();
var config = new ConfigurationBuilder().AddInMemoryCollection(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
{
public class ResponseTests
{
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on mono.")]
[Fact]
public async Task LargeDownload()
{
var port = PortManager.GetPort();
Expand Down Expand Up @@ -80,8 +79,7 @@ public async Task LargeDownload()
}
}

[ConditionalTheory, MemberData(nameof(NullHeaderData))]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on mono.")]
[Theory, MemberData(nameof(NullHeaderData))]
public async Task IgnoreNullHeaderValues(string headerName, StringValues headerValue, string expectedValue)
{
var port = PortManager.GetPort();
Expand Down Expand Up @@ -129,8 +127,7 @@ public async Task IgnoreNullHeaderValues(string headerName, StringValues headerV
}
}

[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on mono.")]
[Fact]
public async Task OnCompleteCalledEvenWhenOnStartingNotCalled()
{
var port = PortManager.GetPort();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
"Microsoft.AspNetCore.Testing": "1.0.0-*",
"Microsoft.NETCore.Platforms": "1.0.1-*",
"System.Net.Http": "4.0.1-*",
"xunit": "2.1.0"
},
"frameworks": {
"dnxcore50": {
"dependencies": {
"dotnet-test-xunit": "1.0.0-dev-*"
"dotnet-test-xunit": "1.0.0-dev-*",
"System.Net.Http": "4.0.1-*"
},
"imports": "portable-net451+win8"
},
"dnx451": {
"dependencies": {
"xunit.runner.console": "2.1.0"
},
"frameworkAssemblies": {
"System.Net.Http": "4.0.0.0"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Testing.xunit;
using Xunit;

namespace Microsoft.AspNetCore.Server.KestrelTests
{
public class ChunkedResponseTests
{
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on Mono.")]
[Fact]
public async Task ResponsesAreChunkedAutomatically()
{
using (var server = new TestServer(async httpContext =>
Expand Down Expand Up @@ -45,8 +43,7 @@ await connection.ReceiveEnd(
}
}

[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on Mono.")]
[Fact]
public async Task ZeroLengthWritesAreIgnored()
{
using (var server = new TestServer(async httpContext =>
Expand Down Expand Up @@ -79,8 +76,7 @@ await connection.ReceiveEnd(
}
}

[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on Mono.")]
[Fact]
public async Task EmptyResponseBodyHandledCorrectlyWithZeroLengthWrite()
{
using (var server = new TestServer(async httpContext =>
Expand All @@ -107,8 +103,7 @@ await connection.ReceiveEnd(
}
}

[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on Mono.")]
[Fact]
public async Task ConnectionClosedIfExeptionThrownAfterWrite()
{
using (var server = new TestServer(async httpContext =>
Expand Down Expand Up @@ -138,8 +133,7 @@ await connection.ReceiveEnd(
}
}

[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on Mono.")]
[Fact]
public async Task ConnectionClosedIfExeptionThrownAfterZeroLengthWrite()
{
using (var server = new TestServer(async httpContext =>
Expand Down Expand Up @@ -168,8 +162,7 @@ await connection.ReceiveEnd(
}
}

[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on Mono.")]
[Fact]
public async Task WritesAreFlushedPriorToResponseCompletion()
{
var flushWh = new ManualResetEventSlim();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Server.Kestrel.Filter;
using Microsoft.AspNetCore.Testing.xunit;
using Xunit;

namespace Microsoft.AspNetCore.Server.KestrelTests
Expand All @@ -31,8 +29,7 @@ private async Task App(HttpContext httpContext)
}
}

[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on Mono.")]
[Fact]
public async Task CanReadAndWriteWithRewritingConnectionFilter()
{
var filter = new RewritingConnectionFilter();
Expand All @@ -58,8 +55,7 @@ await connection.ReceiveEnd(
Assert.Equal(sendString.Length, filter.BytesRead);
}

[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on Mono.")]
[Fact]
public async Task CanReadAndWriteWithAsyncConnectionFilter()
{
var serviceContext = new TestServiceContext()
Expand All @@ -83,8 +79,7 @@ await connection.ReceiveEnd(
}
}

[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Test hangs after execution on Mono.")]
[Fact]
public async Task ThrowingSynchronousConnectionFilterDoesNotCrashServer()
{
var serviceContext = new TestServiceContext()
Expand Down
Loading