The only change to the logic is that the tests now use RemoteInvoke to run each test in its own process, so as to avoid EventSource and DiagnosticSource interference.
Also removed the xunit attributes from the assembly that prevented parallelization. It's no longer needed as of this change.
Commit migrated from https://github.com/dotnet/corefx/commit/542d85e15bfe5fdeb59d7e6f7fb3b15a08640ebd
Reading from the response stream using ReadAsync() was ignoring the cancellation token passed in. To fix this, registered a delegate that will be called to dispose the WinHTTP request handle during pending I/O. This will cause the WinHTTP operation to cancel.
Added tests. For now, left them disabled to be resolved in issue dotnet/corefx#8692 next week. But wanted to get this fix in asap since it blocks partners for RTM.
Fixesdotnet/corefx#8662.
Commit migrated from https://github.com/dotnet/corefx/commit/a6e019d8e1910b9fed3c1077be23bfd9023d2837
I'd added this when bringing properties from WinHttpHandler to CurlHandler in bulk, with the expectation that we might expose them. Since we're not planning on exposing this particular property from HttpClientHandler (turns out it's not very useful in practice), I'm removing it.
Commit migrated from https://github.com/dotnet/corefx/commit/953bbe0006ce7f29c87b798eb10d072df06d6f99
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.
Fixesdotnet/corefx#2383.
Commit migrated from https://github.com/dotnet/corefx/commit/3603ed2578220f0ecb2f101324e04acb80fa3196
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
These tests require the client and server to be on a Windows Active Directory domain. These tests are Windows specific. Currently this cannot be done in the CI system. So, these tests are only enabled when an environment variable is set which points to the test server.
There is a separate todo item dotnet/corefx#4989 to provide more automated scripts for setting up the test server. For now, there is a readme file with some details.
These tests will help support fixes for dotnet/corefx#8176 and related bugs.
Commit migrated from https://github.com/dotnet/corefx/commit/4739da8c8d4965fdaf2fc45ae915297208672d15
We've standardized on using Unix in most cases where we only cross-
compile once for Unix. This change cleans up mentions of Linux/OSX when
we aren't actually cross-compiling for those OSes.
The remaining projects that still cross-compile for Linux/OSX are:
System.Diagnostics.Process
System.IO.FileSystem.Watcher
System.Net.NetworkInformation
The System.Net.Security functional tests seem to still have a distinct
difference in functional behavior on OSX so I have also left these
configured to cross-compile for Linux/OSX.
Commit migrated from https://github.com/dotnet/corefx/commit/16ee317fa4e194ff7cf61e923caf103909e391f1
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
To support important customer scenarios for CoreFx RTM, we will be updating the System.Net.Http contract from 4.0 to 4.1. We are focusing on HttpClientHandler enhancements.
We will be submitting the final proposed list of additions as part of issue dotnet/corefx#7623. As part of updating the contract to 4.1, we are also OOB'ing the Desktop (net46 Windows) implementation so that the package won't be a facade over Desktop but rather a full implementation. This is possible since System.Net.Http has always been a standalone dll in the .NET Framework. As part of this, we are changing the implementation for Desktop from the legacy HttpWebRequest sockets stack to the WinHttpHandler stack based on native WinHTTP. This will give us a good path forward as WinHttpHandler stack will be getting HTTP/2.0 support with newer versions of Windows 10.
This initial PR has a few API additions that we are definitely going to be adding. It's important to get these changes into the builds so that we can fully bake the OOB Http.dll assembly on all the platforms and continue package testing.
There is an existing System.Net.Http.WebRequestHandler class in the .NET Framework located in System.Net.Http.WebRequest.dll. This class is a subclass of HttpClientHandler. Due to this, we are being careful not to cause collisions with some of these added properties. WebRequestHandler has a 'ClientCertificates' property and a 'ServerCertificateValidationCallback' property. So, we are aligning/renaming the properties as we add them to HttpClientHandler OOB assembly. This may get altered slightly as we finalize the 4.1 System.Net.Http API.
Commit migrated from https://github.com/dotnet/corefx/commit/97c940eec1f6afe3e4af31e72d79c3a11e7b1ff1
Add CurlHandlers.SslProtocols option
With libcurl on the OpenSSL backend (the recommended configuration), we can provide full-fidelity for this option. With libcurl on another SSL backend, we can allow choosing all three TLS protcols or just one TLS protocol, but we can't support selecting two of the three.
Commit migrated from https://github.com/dotnet/corefx/commit/bd79e80f25923e0f2e29e07aba60b03070596bb4
We don't currently have any functional tests in the repo for using HTTP proxies. This commit adds a very simple loopback GET request proxy server, just enough to verify that HttpClient does go through the specified proxy and pass credentials if requested. If/when we get better infrastructure in place for this kind of thing, we can remove the proxy implementation and replace the test, but for now, this at least provides some automated verification cross-platform.
Commit migrated from https://github.com/dotnet/corefx/commit/db2d84b0bb4032ca21b8e7c9cfd96056ffddbab2
Several bugs are causing tests to fail. Those bugs have been fixed, but the fixes aren't yet available in the packages being targeted by other test libraries breaking because of the bugs. This temporarily works around it by using a P2P reference to skip the packages.
Commit migrated from https://github.com/dotnet/corefx/commit/5eb4a0405e16f1cc7d2488f9106f644141f62de5
This add a default configuration before the Import of dirs.props
for any projects that don't have Debug as the default configuration.
Removed Configuration and Platform properties set after dirs.props
as they would have no affect and just cause confusion.
Removed OutputType=Library property as it isn't necessary.
Commit migrated from https://github.com/dotnet/corefx/commit/9e1da13cf6d5ff4b37b1867beb3411a2fe61da6a
* Move more tests to the new test server
* Cleanup 'var' coding patterns
* Remove duplicate tests (*Content clas related) that are already covered with the *Content class tests
* Utiilize the newer test server VerifyUpload endpoint which does 'Content-MD5' verification of transmitted payload to the server
as well as payload from the server
* Add GZip related tests in addition to Deflate compression schemes
Commit migrated from https://github.com/dotnet/corefx/commit/773c8ae1db5aa7e5d695a74fb63968382f8529da
Added tests for validating against all standard and custom HTTP verbs. These tests use the new networking test server.
Cosolidated some existing tests that were duplicative. More test porting and reorganzing will be done in later PRs.
Commit migrated from https://github.com/dotnet/corefx/commit/057f0a9bc938606f9e3a24a51f64f3a4fd9bbb55
WinHttpHandler was hanging due to blocking on the WinHTTP status callback thread. The blocking was coming from a task continuation resuming on the same thread and subsequently calling a blocking Stream.Write method in a custom HttpContent class being written onto the request stream.
Blocking is not allowed on the WinHTTP callback thread. So any task continuations need to occur on a different thread. The fix is to create the TaskCompletionSources to use RunContinuationsAsynchronously. This allows them to unblock the WinHTTP thread. Additionally, I added some missing ConfigureAwait(false) settings to some await'd operations.
Added a new test which uses a custom HttpContent class that uses a blocking Write() call when serializing onto the request stream.
Fixdotnet/corefx#4077
Commit migrated from https://github.com/dotnet/corefx/commit/babb7c6c65bf1e02dab667cbda80f0e24af21ed8
Our common tests folder has gotten a bit unwieldy in its organization. This change simply moves files around to better map to how src\Common\src is organized. Files are now stored in a path based on functionality/namespace.
I mostly kept groups of functionality together and did not attempt to reorganize at that level, e.g. I moved the src\Common\tests\System.Xml.XPath\ folder to be src\Common\tests\System\Xml\XPath\ and did not further reorganize all of the folders/files it contains. Such cleanup can be done separately on each individual area.
Some of the files also need to be cleaned up internally, e.g. the namespace (or lack thereof), so I put such things in a path that I thought made sense even if it differs from the current namespace in the file; I wanted this change to be relatively simple and just be about moving files around to clean up the main hierarchy.
Commit migrated from https://github.com/dotnet/corefx/commit/9a5546c439f7700d3462564678aa4206c7fbf4f1
Ported more HTTP related tests. These tests focus mostly on POST
scenarios mixed with authentication, pre-authentication, and the
"rewind-ability" of content if it needs to be re-POST'd due to AUTH
challeges by the server.
Added a new HttpTestServers2 class to Common/tests/System/Net. This is a
point-in-time thing as we improve the test infrastructure capability. In
particular, we are moving away from the use of the "httpbin.org" server.
Our new networking test server that we are bringing up has more features
than httpbin.org. It can support all the main HTTP verbs when doing "echo"
of request headers. It includes a "Content-MD5" HTTP response header. This
contains a hash of the response body. This makes it easier to validate the
returned payloads. The "httpbin.org" server also has a bug where it does
not properly echo chunked upload headers which was causing issues when
trying to port these tests.
I did not change other networking tests still using "httpbin.org" and the
Common HttpTestServers class. I will be doing that later as we finalize
the test infrastructure.
Commit migrated from https://github.com/dotnet/corefx/commit/f14225a7355bdae2468bb3c28562da0a0976f206
* Add more tests ported from the internal ToF tests.
* Cleanup existing tests to be consistent in style and format as it has
drifted due to many different people working on the tests.
* Disposing the HttpClient object will dispose the handler as well so we
don't need multiple 'using' statements unless we are explicitly testing
dispose ordering semantics.
Commit migrated from https://github.com/dotnet/corefx/commit/ad55c1d5685afc4009cb2481fcc7c5e4f4a551f8
Added more http tests to open source from the original internal ToF tests. Some of
the tests should be refactored in the future to avoid Assert'ing multiple
logical things.
Fixed up test namespaces for System.Net.Http and
System.Net.Http.WinHttpHandler.
Commit migrated from https://github.com/dotnet/corefx/commit/e5a017cb6ca01e99b1f1462298bc0cbf60c06ee0