Commit Graph

12 Commits

Author SHA1 Message Date
Stephen Halter f4d27e67bb
Improve server shutdown logic (#2247)
Ensure connections abort when they don't close gracefully.
2018-01-16 16:43:45 -08:00
Stephen Halter 02028b65c7 Stop using ConcurrentBag in tests for complex types (#1990)
dotnet/corefx#23068
2017-08-11 16:30:03 -07:00
David Fowler 7ebbdad974 Add support for connection scopes if logging is enabled (#1953)
* Add support for connection scopes if logging is enabled
- Don't create a scope if logging isn't on
- Copied the pattern we use in Hosting
2017-07-12 11:45:08 -07:00
Stephen Halter 6c0af445e5 Fix flaky test and improve TestServer (#1859) 2017-05-24 15:45:54 -07:00
Stephen Halter 11ab602b2f Make timeout logic transport agnostic (#1649)
* Make timeout logic transport agnostic

* PR feedback

* More PR feedback
2017-04-12 16:15:46 -07:00
Cesar Blum Silveira f253dbc0c0 Split transport-specific tests and general tests into distinct test projects (#1588).
* Rename EngineTests to LibuvTransportTests.
* Move libuv-specific tests into their own test project.
* Move LibuvOutputConsumerTests.AllocCommitCanBeCalledAfterConnectionClose to new OutputProducerTests class and rename it to WritesNoopAfterConnectionCloses.
* Remove TransportContext from TestServiceContext.
* Make KestrelTests depend on Kestrel.Core only.
* Rename Microsoft.AspNetCore.Server.Kestrel.KestrelTests to Microsoft.AspNetCore.Server.Kestrel.Core.Tests.
* Add Microsoft.AspNetCore.Server.Kestrel.Tests test project for WebHostBuilderKestrelExtensionsTests.
* Increase socket receive timeout in MaxRequestBufferSizeTests to mitigate flakiness.
* Anything using TestServer should be a functional test.
* Move out of LibuvTransportTests tests that are not specific to LibuvTransport.
  - Move to RequestTests:
    - Http11 (rename to Http11KeptAliveByDefault)
    - Http10ContentLength (rename to Http10NotKeptAliveByDefault)
    - Http10KeepAlive
    - Http10KeepAliveNotUsedIfResponseContentLengthNotSet (rename to Http10KeepAliveNotHonoredIfResponseContentLengthNotSet)
    - Http10ContentLengthKeepAlive (rename to Http10KeepAliveHonoredIfResponseContentLengthSet)
    - Expect100ContinueForBody (rename to Expect100ContinueHonored)
    - ZeroContentLengthAssumedOnNonKeepAliveRequestsWithoutContentLengthOrTransferEncodingHeader
    - ConnectionClosesWhenFinReceivedBeforeRequestCompletes (test was actually not marked as Theory, and was incorrect)
    - RequestsCanBeAbortedMidRead
    - RequestHeadersAreResetOnEachRequest
    - UpgradeRequestIsNotKeptAliveOrChunked
    - HeadersAndStreamsAreReused (rename to HeadersAndStreamsAreReusedAcrossRequests)
  - Move to ResponseTests:
    - Http10RequestReceivesHttp11Response (rename to Http11ResponseSentToHttp10Request)
    - ZeroContentLengthSetAutomaticallyAfterNoWrites
    - ZeroContentLengthSetAutomaticallyForNonKeepAliveRequests
    - ZeroContentLengthNotSetAutomaticallyForHeadRequests
    - ZeroContentLengthNotSetAutomaticallyForCertainStatusCodes
    - ConnectionClosedAfter101Response
    - ThrowingResultsIn500Response
    - ThrowingAfterWritingKillsConnection
    - ThrowingAfterPartialWriteKillsConnection
    - ThrowingInOnStartingResultsInFailedWritesAnd500Response
    - ThrowingInOnCompletedIsLoggedAndClosesConnection
    - FailedWritesResultInAbortedRequest
    - NoErrorsLoggedWhenServerEndsConnectionBeforeClient
    - NoResponseSentWhenConnectionIsClosedByServerBeforeClientFinishesSendingRequest
    - ResponseHeadersAreResetOnEachRequest
    - OnStartingCallbacksAreCalledInLastInFirstOutOrder
    - OnCompletedCallbacksAreCalledInLastInFirstOutOrder
  - Remove:
    - RePathEscapeTests (theory data to HttpParsingData)
    - ReDisconnectingClient (what was that testing?)
2017-04-06 19:09:40 -07:00
Cesar Blum Silveira 7ceea5323a Rename namespaces/directories/classes in Kestrel.Core and Transport.Libuv (#1582).
- Put everything in the libuv transport package under `Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.*` namespaces.
- Move stuff in Transport.Libuv/Internal/Http and Transport.Libuv/Internal/Infrastructure to Transport.Libuv/Internal (keep the Networking directory for the libuv wrappers).
- Add `Libuv` prefix to most libuv internal classes.
- Rename `KestrelEngine` to `LibuvTransport`.
- Rename `SocketOutputConsumer` to `LibuvOutputConsumer`.
- Rename `SocketOutputProducer` to `OutputProducer`.
- Fix namespaces in `Microsoft.AspNetCore.Server.Kestrel.Core.`
2017-04-04 13:45:02 -07:00
Stephen Halter 5124adf450 Better report Kestrel crashing errors 2017-02-07 00:26:00 -08:00
Stephen Halter f32058c5c3 Warn instead of throw when ignoring IServerAddressesFeature
- Throwing could be too much when IServerAddressesFeature URLs come from VS
- Listen on 127.0.0.1:5000 by default

https://github.com/aspnet/Hosting/issues/917
2017-01-19 11:36:19 -08:00
Stephen Halter b2d45c3dd0 Make TestApplicationErrorLogger thread-safe 2016-11-21 16:31:27 -08:00
Cesar Blum Silveira f8813a600d Handle response content length mismatches (#175). 2016-10-11 13:25:22 -07:00
Cesar Blum Silveira 19f8958fa8 Move TestServer to shared directory. 2016-09-06 12:47:24 -07:00