Improve HttpClient POST tests stability (dotnet/corefx#36801)
authorDavid Shulman <david.shulman@microsoft.com>
Fri, 12 Apr 2019 00:31:25 +0000 (17:31 -0700)
committerGitHub <noreply@github.com>
Fri, 12 Apr 2019 00:31:25 +0000 (17:31 -0700)
commit4484947e53370d281c2c224f27855af8a40c3099
tree5a66f77066ee1703c04828a0b6cc2ee45edc635e
parent0474ec9b5d08b534e0fd3e96c23e75b47be9afa0
Improve HttpClient POST tests stability (dotnet/corefx#36801)

Several of the HttpClient POST scenario tests were failing with HTTP status code 500. This was caused
by the Azure remote endpoint generating OutOfMemoryException at times. The tests are sending
large amounts of request body data to the Echo endpoint. That endpoint will respond back with all
the headers and request body data serialized into a JSON payload. The OOM exceptions were
coming from the Newtonsoft JSON serialization code currently used by the server endpoint.

These tests don't really require that the request body data be sent back. The purpose of the tests is
to verify that the request body payload was correctly sent by the client. We already have an endpoint,
VerifyUpload, that can do that without echo'ing back the large request body data.

This PR modifies the tests to use that endpoint. This should mitigate the OOM exceptions
currently being generated in the server-side code. Additional mitigations/fixes will be done later on the server-side code to improve robustness. But fixing the tests to be more streamlined is goodness and will result in these tests being faster and more stable.

Closes dotnet/corefx#36782

Commit migrated from https://github.com/dotnet/corefx/commit/288ce93787799052705814876d6e5ccb0523797d
src/libraries/Common/tests/System/Net/Configuration.Http.cs
src/libraries/System.Net.Http/tests/FunctionalTests/PostScenarioTest.cs