Commit Graph
19 Commits
Author SHA1 Message Date
Geoff Kizer b94eefba0f reorganize and cleanup some LoopbackServer code
Commit migrated from https://github.com/dotnet/corefx/commit/ec6a7215bb28a061d2357d8c3874447bc575132d
2018-02-13 15:43:59 -08:00
Stephen Toub d1e0b0b1bd Fix HttpClientMiniStress.UnreadResponseMessage_Collectible test (dotnet/corefx#27061)
The async state machine was holding a reference to the response content object, which in turn prevented the response stream from being collected.

Commit migrated from https://github.com/dotnet/corefx/commit/6c9b62981190ae5886196f37d0f5dc614f4b0244
2018-02-12 13:39:02 -05:00
Geoff Kizer a8ffcf7322 fix stress response generation, and disable failing test (dotnet/corefx#27059)
Commit migrated from https://github.com/dotnet/corefx/commit/472c3d95749910ba600df296bbf01d78d7c4f6d8
2018-02-12 07:25:24 -05:00
Tarek Mahmoud Sayed 9a37559457 Enable Stress mode environment variable (dotnet/corefx#26808)
* Enable Stress mode environment variable

To write any stress test, you may mark the stress test case with one of the attributes:

[ConditionalFact(typeof(TestEnvironment), nameof(TestEnvironment.IsStressModeEnabled))]
[ConditionalTheory(typeof(TestEnvironment), nameof(TestEnvironment.IsStressModeEnabled))]

and set the value of the environment variable COREFX_STRESS to 1 or true

* apply the stress mode detection on System.Net.Http

* remove un-needed comments


Commit migrated from https://github.com/dotnet/corefx/commit/3d38415b8df3a707834e05830a9f78185ebd7b18
2018-02-03 06:05:59 -05:00
Stephen Toub 7be9b5bb5f Switch tests to use thread-local switch for ManagedHandler
And as a result re-enable parallelism of the test suite, which on my machine reduces the running time of the outerloop tests from 150s to 45s.


Commit migrated from https://github.com/dotnet/corefx/commit/3db504ec31fb03162b33e0658870aef5af4e4abe
2017-09-21 08:26:44 -04:00
Stephen Toub ba9c884896 Enable ManagedHandler_HttpClientMiniStress tests
One test needed to be fixed to deal with the fact that currently the ManagedHandler doesn't throttle connections and can end up getting denied connection errors from the server when exceeding the listen backlog size employed.


Commit migrated from https://github.com/dotnet/corefx/commit/47ffa8b49cf3d04be888f4d1e1dc287cdcbbe5e5
2017-07-05 12:43:12 -04:00
Eric St. John f6f23740a5 Update Http tests to target ns1.7 + ns1.3
I had to add a namespace alias due to System.Configuration now being
defined by System.Runtime.


Commit migrated from https://github.com/dotnet/corefx/commit/6e86da5cc3efb88db6b932f01c9a4f9e66e84f8c
2016-10-20 14:31:18 -07:00
David Shulman 9449dda9a7 Enhance LoopbackServer to return received data
Modified the test LoopbackServer so that it can return the received data in the helper methods. This allows more use of the
simple ReadRequestAndSendResponseAsync() method instead of having to use the more complex methods.

Modified a few HttpClient tests to take advantage of this. More tests will be simplified in future PRs.


Commit migrated from https://github.com/dotnet/corefx/commit/14c8ddd89be1fac31a472efdcaee184ba9d62e58
2016-08-26 12:11:43 -07:00
Cristian Pop 7a3d76b180 Adding multi-machine scripts and unifying configuration.
Commit migrated from https://github.com/dotnet/corefx/commit/c354b2d44f6988a20a9f7be4a1b996ef7fbc873a
2016-06-28 12:38:07 -07:00
Stephen Toub 00f486042d Fix HttpClientMiniStressTests tests
These were broken at some point (almost all of the tests fail, complaining about invalid responses from the server), but we didn't notice because they're not enabled by default.


Commit migrated from https://github.com/dotnet/corefx/commit/ef77613d8732beab380b058368bb7bcf2cc54369
2016-06-03 15:42:48 -04:00
David Shulman 6489f6d1c9 Add configurable test settings for Http and WebSocket tests (dotnet/corefx#8480)
Building on the current use of environment variables for passing in test settings, added a common test helper class to allow the http and websocket tests to access alternate test servers. This will help with load balancing and network latency issues which are causing occasional timeouts in CI tests. This will also allow developers to run their own version of the Azure test endpoints. Consolidated the current environment variables used and standardized on a naming format.

Fixes dotnet/corefx#2383.

Commit migrated from https://github.com/dotnet/corefx/commit/3603ed2578220f0ecb2f101324e04acb80fa3196
2016-05-12 14:57:03 -07:00
stephentoub 514492a454 Don't cancel all requests when HttpClient disposed on Unix
On Unix when an HttpClientHandler is disposed, we cancel all outstanding operations associated with that handler.  It turns out this isn't the desired behavior (aka the behavior of WinHttpHandler), which is that we should cancel all outstanding operations that haven't yet published its HttpResponseMessage, but for requests where the HttpResponseMessage has been published, it should remain valid.

This commit tweaks the behavior accordingly and adds a test for it.


Commit migrated from https://github.com/dotnet/corefx/commit/f949d92b3ee26168277f56fbd2c6686505ea0b4a
2016-05-12 14:27:51 -04:00
stephentoub b8970ee51b Add SSL support to LoopbackServer in HTTP tests
We currently make a lot of calls off-box in our unit tests.  By adding SSL support to the loopback server, we should be able to convert many more tests to avoid needing to actually hit the network.  This adds such basic support, and converts a few tests to use it.

Also, since I was moving the certificate configuration code to a central location, I fixed an issue related to cleanup.


Commit migrated from https://github.com/dotnet/corefx/commit/b90795e1d5d7e8d8c68b9ca23d53b1ba0e392f46
2016-05-10 13:55:40 -04:00
stephentoub 120b636957 Correctly annotate a stress test with HttpStressEnabled
It's failed a few times in outerloop; we only want it enabled when we're doing a stress test and nothing else is running, as the time it takes can fluctuate if lots of other things are running.


Commit migrated from https://github.com/dotnet/corefx/commit/d80099c00a3f55acc83089d32794e700171c3030
2016-04-30 06:53:02 -04:00
stephentoub 6e8cc68acf Consolidate loopback server code to LoopbackServer.cs
Also add Date header to responses


Commit migrated from https://github.com/dotnet/corefx/commit/f4804b5f54a9fe60b0dad794936c7b73b47be19f
2016-04-28 08:42:36 -04:00
stephentoub a2977e9fad More HttpClient test fixes and additions
- The GetAsync_ResponseWithSetCookieHeaders_AllCookiesRead test has been failing with some regularity in CI, with strange GatewayTimeout errors.  I don't know why this particular test is so much more susceptible to that, but I've changed the test to use a local loopback server rather than an external site.

- The SendAsync_ReadFromSlowStreamingServer_PartialDataReturned test was relying on timings from the server that might not always be correct, and due to internal differences between curl and WinHttp were very frequently wrong on Unix such that the test was disabled there.  I reimplemented it with a local loopback server, too.

- I've added another mini-stress test, with posts instead of gets.


Commit migrated from https://github.com/dotnet/corefx/commit/9b6a0224c3e404afe3f2c58dfb59e2068391c879
2016-04-27 13:44:35 -04:00
stephentoub b12f72bd7d Add more HttpClient stress tests
Commit migrated from https://github.com/dotnet/corefx/commit/1482013de9fa08e5834d92ce2884c194f93662fb
2016-04-26 10:41:41 -04:00
stephentoub 016a8bda35 Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/13b80c9fba1d358ad65519984b36b6b0a017c19e
2016-04-23 11:10:35 -04:00
stephentoub 6c4c36cd4d Add several outerloop HttpClient tests
Several "mini-stress" tests that verify HttpClient doesn't completely fall over under some load:
- Use one HttpClient instance to make many requests serially and in parallel
- Use multiple HttpClient instances to make many requests serially and in parallel
- Ensure that HttpResponseMessages can be GCd even if the associated response hasn't been fully drained.  This one fails right now on unix due to an open issue.


Commit migrated from https://github.com/dotnet/corefx/commit/4358712d3db870725a394478702e643018af52bf
2016-04-22 18:22:41 -04:00