Commit Graph
2257 Commits
Author SHA1 Message Date
David Shulman 420e273807 Merge pull request dotnet/corefx#42324 from davidsh/disable_hanging_tests
Disable hanging tests

Commit migrated from https://github.com/dotnet/corefx/commit/d65822a3f6aa21844aceeedb7fce9cdf10af96c2
2019-11-02 14:31:29 -07:00
David Shulman a7c95ab9a6 Disable hanging tests
Contributes to dotnet/corefx#42323


Commit migrated from https://github.com/dotnet/corefx/commit/2c3cb3c1b05626ecd8c0df3e1a06466e34621ba8
2019-11-02 14:29:55 -07:00
Chris Ross 3e8cb443f3 Setup HTTP/2 code for sharing (dotnet/corefx#42070)
Commit migrated from https://github.com/dotnet/corefx/commit/832dfd260bdebffdff91cb67eecbb8b02d5eaff2
2019-11-01 17:31:16 -07:00
Viktor Hofer 926874e00a Use Package suffix instead of PackageId and Version suffix instead of PackageVersion (dotnet/corefx#42289)
* Use Package suffix instead of PackageId

* Manual darc update from build '20191101.2'


Commit migrated from https://github.com/dotnet/corefx/commit/931f79e4670cb73c9347e14714fd892907be6630
2019-11-01 18:27:23 +01:00
Eirik TsarpalisandStephen Halter 791f01a0d7 HttpStress: add docker documentation (dotnet/corefx#42268)
* httpstress: add documentation on dockerized stress runs

* fix stress yml issue

* fix doc issues

* remove commented out code

* remove accidental change

* yaml pipeline variables naming consistency

* Update eng/pipelines/stress/http-linux.yml

Co-Authored-By: Stephen Halter <[email protected]>


Commit migrated from https://github.com/dotnet/corefx/commit/4c3bd8a0533a2e35df371b91045a1a5f0ada7d54
2019-10-31 22:46:28 +00:00
Eirik Tsarpalis 5a7ed95219 Use docker-compose for running stress tests (dotnet/corefx#42186)
HttpStress: add docker-compose scenario


Commit migrated from https://github.com/dotnet/corefx/commit/df648522fd1a1bfaa14e9d1ae7c2eaf4a9c87a7c
2019-10-29 16:46:09 +00:00
Viktor Hofer d2999dc804 Remove versionless netstandard target group (dotnet/corefx#41984)
Commit migrated from https://github.com/dotnet/corefx/commit/26d7b6626ab0385a1158e674855f81ab73f628e0
2019-10-27 17:08:59 +01:00
Stephen Toub 3908711d1d Remove ILLinkTrim.xml from System.Net.Http (dotnet/corefx#42126)
The file was there to keep anonymous types used by DiagnosticsHandler from having their getters removed.  But a) it was relying on the implementation detail name generated by Roslyn, and b) it was keeping alive other state from other anonymous types in the assembly.  I changed it to use concrete types instead.  This also happens to result in less code, because we don't need the generated Equals/GetHashCode methods generated for anonymous types.

Commit migrated from https://github.com/dotnet/corefx/commit/b8a21f62f29ca98394c30151bdd72ff36f10765c
2019-10-26 16:02:39 -04:00
Eirik Tsarpalis ca723882d4 HttpStress: Add Stress Pipelines (dotnet/corefx#41833)
Commit migrated from https://github.com/dotnet/corefx/commit/f41ba828c76126a871d986cb5b7e9c44ddf6f3d7
2019-10-25 00:02:30 +01:00
Stephen Toub d7a062e5cd Fix a rare GetAwaiter().GetResult() on a ValueTask in System.Net.Http (dotnet/corefx#41958)
* Fix a rare GetAwaiter().GetResult() on a ValueTask in System.Net.Http

If someone's custom HttpContent-derived type is implementing their async SerializeToStreamAsync with synchronous Write calls on the destination stream, and if that WriteAsync method returns an IValueTaskSource-based ValueTask that's not yet completed, this could throw an exception.   This is unlikely to actually negative impact anyone right now, but it's worth fixing.  This is one of the patterns an analyzer around ValueTasks will help find and fix.

* Update src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpBaseStream.cs


Commit migrated from https://github.com/dotnet/corefx/commit/f37f05d4a7d916f14980456e9ddb95d2708efa24
2019-10-22 10:23:15 -04:00
Viktor Hofer e8803ace6e Disabling TaskCanceledQuickly timing out test (dotnet/corefx#41941)
Commit migrated from https://github.com/dotnet/corefx/commit/69fc7edb110a69345253060bb611deb3d4bec417
2019-10-21 15:06:57 +02:00
Viktor Hofer 9b88ca1d72 Remove UAP target (dotnet/corefx#41759)
* Remove Uap target

* Remove RemoteInvokeForUap wrapper calls entirely

* Harvest S.D.SqlClient on UWP

* Disable UWP PInvoke analyzer

* Enable WindowsRuntime* tests on netcoreapp

Commit migrated from https://github.com/dotnet/corefx/commit/3b6ec2ba944fb72f921f95b99b6ebf2e7bb3dc5a
2019-10-17 15:04:39 +02:00
Cory Nelson 4ab1d46ca8 HTTP2: Support receiving dynamic table headers (dotnet/corefx#41295)
Support HTTP2 dynamic table header decode. Improve some exception messaging in HPACK decoder. Resolves dotnet/corefx#41208

Commit migrated from https://github.com/dotnet/corefx/commit/7487aec03dc27b910ad4ea096544b850afc74876
2019-10-16 15:28:50 -07:00
Eriawan Kusumawardhono 89174f25b0 Replace tfm based constants with SDK ones (dotnet/corefx#41601)
* replace DefineConstants with SDK ones

Commit migrated from https://github.com/dotnet/corefx/commit/2133679ff62222ba2734232ab8fa4c65765e82a2
2019-10-15 19:11:40 +02:00
Stephen Toub 7ff3a1100a Reduce RemoteInvoke usage in tests (dotnet/corefx#41741)
Many of our RemoteInvokes are there purely because of needing to change the current thread culture but on UAP that actually impacting the whole process.  Until that's addressed, we can at least avoid the RemoteInvoke on all platforms other than UAP. There are also some RemoteInvokes that can be avoided by just serializing all of the (small number of) tests in a test assembly. And there's some additional cleanup to be done as well around not explicitly returning an exit code unless required.

This helps measurably with test performance.  Consider the System.ComponentModel.Annotations test suite.  On my machine, prior to these changes, it took ~25 seconds; after these changes, it takes ~0.3. It helps even more when running against a checked runtime, where all of our test costs are magnified.  With a checked runtime, prior to these changes, it takes ~196 seconds; after these changes, it takes ~2.5 seconds.  This should help measurably with CI time in coreclr.

Commit migrated from https://github.com/dotnet/corefx/commit/cd18bafbabf7fe47601f6f790d157409034a2477
2019-10-15 12:09:06 -04:00
Eirik Tsarpalis 41a0c3d337 HttpStress: Add scripts for loading the corefx testhost in the environment (dotnet/corefx#41721)
HttpStress: add testhost environment loader scripts


Commit migrated from https://github.com/dotnet/corefx/commit/faefe04a1cd88053cb8d63028494dfe7ea1a97ec
2019-10-14 13:59:16 +01:00
Stephen Toub 48c5afd0e5 Make WebRequest.GetSystemWebProxy() return a working proxy (dotnet/corefx#41692)
* Make WebRequest.GetSystemWebProxy() return a working proxy

Today it returns a singleton on .NET Core that throws PlatformNotSupportedExceptions, and is only used for its reference identity by the WebRequest implementation.  This is problematic for existing code that's taking this proxy and passing it to, for example, ClientWebSocket's Proxy, as it will end up being an expensive nop.  In fact, there's currently no way when targeting netstandard2.0 to tell ClientWebSocket to use a default proxy.

With this fix, WebRequest.DefaultWebProxy (which just defaults to GetSystemWebProxy()) will now return HttpClient.DefaultProxy, which is actually a working proxy implementation.

* Stop throwing NotSupportedException from HttpClient.DefaultProxy.set_Credentials

The OS and how the environment is configured determines what concrete type is returned from HttpClient's DefaultProxy property.  And currently these different types behave differently from set_Credentials.  Two of them are throwing NotSupportedException, which is not expected from the IWebProxy interface.  We should just roundtrip the credentials set, even if they're not used.


Commit migrated from https://github.com/dotnet/corefx/commit/8d21b79b924d29088dbde46d42737a657d466b5e
2019-10-12 08:15:05 -04:00
David Shulman b457137b1e Re-enable NoCallback_RevokedCertificate_NoRevocationChecking_Succeeds test
The third-party server we use for this test, revoked.badssl.com, now has a new
certificate that is good for another two years and is also revoked. So, we can
re-enable this test.

Fixes dotnet/corefx#41108


Commit migrated from https://github.com/dotnet/corefx/commit/0dd95fc3d4bd24db0fd860295c5873703d7738f5
2019-10-10 12:34:49 -07:00
Stephen Toub 6adeb9be60 Change some internal async Task methods to be async ValueTask (dotnet/corefx#40527)
We have some internal and private `async Task` methods that are only ever `await`ed.  Today there's no benefit to making them `async ValueTask` methods, so we've kept them as `async Task`.  However, if we end up changing the implementation of `async ValueTask` to pool underlying objects, there becomes a potential benefit to using `async ValueTask` for these instead of `async Task`.  This PR changes those in a variety of libraries where we care more about performance and allocations.  There are likely a few more methods we'd want to convert based on profiling, but I believe this represents the bulk of them.

Commit migrated from https://github.com/dotnet/corefx/commit/97d9fb9d6c7e1d50f527e290ef8e18767dbc6bbf
2019-10-10 06:04:01 -04:00
Stephen ToubandDavid Shulman 08b76ee2b9 Remove unnecessary length restriction on Uri.Escape{Data/Uri}String (dotnet/corefx#41686)
* Remove unnecessary length restriction on Uri.Escape{Data/Uri}String

* Address PR feedback

Co-Authored-By: David Shulman <[email protected]>


Commit migrated from https://github.com/dotnet/corefx/commit/1d49632bc213416d27ed6c567fd8dd08e00170a1
2019-10-10 06:03:29 -04:00
Eirik Tsarpalis efb1df60cf Httpstress: add max execution time argument (dotnet/corefx#41643)
HttpStress: add max execution time arg

Adds -maxExecutionTime cli argument.
Enables nullable annotations.

Commit migrated from https://github.com/dotnet/corefx/commit/630924d0ccfbac62195927c0f4514fe33d47c729
2019-10-09 11:53:42 +01:00
Stephen Toub 108bf6bbf7 Several improvements to SocketsHttpHandler perf (dotnet/corefx#41640)
* Do not force-parse TryAddWithoutValidation headers in SocketsHttpHandler

When enumerating headers to write them out, do not force them to be parsed if the user explicitly asked for them not to be with "WithoutValidation".  If the key/values are incorrectly formatted, the request may end up being written incorrectly on the wire, but that's up to the developer explicitly choosing it.

* Revert HttpRequestHeaders.ExpectContinue optimization

Several releases ago, when we weren't paying attention to ExpectContinue, we optimized away the backing field for it into a lazily-initialized collection; that made it cheaper when not accessed but more expensive when accessed, which was fine, as we wouldn't access it from the implementation and developers would rarely set it.  But now SocketsHttpHandler checks it on every request, which means we're paying for the more expensive thing always. So, revert the optimization for this field.

* Avoid allocating a string[] per header

When we enumerate the headers to write them out, we currently allocate a string[] for each.  We can instead just fill the same array over and over and over.


Commit migrated from https://github.com/dotnet/corefx/commit/4d346a9ab7b6e619dae3784283acb87bb7a825c9
2019-10-08 21:22:47 -04:00
Stephen Toub 1e7fc68275 Add ConcurrentDictionary.TryRemove(KeyValuePair) (dotnet/corefx#41597)
Commit migrated from https://github.com/dotnet/corefx/commit/a62579502cb9e86b761c2249d0d04af3d827b3a3
2019-10-07 14:19:57 -04:00
Stephen Toub 95022c31b5 Expose, test, and use ExceptionDispatchInfo.SetCurrentStackTrace
Commit migrated from https://github.com/dotnet/corefx/commit/615990343a9400e46122debf48a5fb08ec452787
2019-10-05 17:07:51 -04:00
Adeel Mujahid d65600b4b0 Replace PrintF with Console.WriteLine and cleanups (dotnet/corefx#41540)
* Replace PrintF with Console.WriteLine and cleanups

* PR feedback: simplify WriteLine arguments


Commit migrated from https://github.com/dotnet/corefx/commit/c28a9e69902bcbc0d742732630bd6e82ac922d5b
2019-10-04 14:48:15 -04:00
Justin Kotalik 9c4e678eb8 Synchronize Http/2 HPack implementation between CoreFx and ASP.NET Core (dotnet/corefx#41069)
Commit migrated from https://github.com/dotnet/corefx/commit/547a2936f07203ad7ac03603fa96d443542ee307
2019-10-02 07:36:01 +09:00
Stephen Toub e851484147 Remove unnecessary dependencies from System.Net.Http (dotnet/corefx#41470)
Commit migrated from https://github.com/dotnet/corefx/commit/e4cfb1761f20b182919db2aeb6ba92b48492c469
2019-10-01 15:43:41 -04:00
Eirik Tsarpalis 534b8d8681 HttpClientHandler functional test: replace remote server dependency (dotnet/corefx#41229)
* HttpClientHandler functional test: replace remote server dependency

Replaces remote server dependency for HttpClientHandler_MaxResponseHeadersLength_Test.SetAfterUse_Throws.
Fixes dotnet/corefx#41148

Commit migrated from https://github.com/dotnet/corefx/commit/b020d0033ffe755f779c564186fc2d98b0af31cc
2019-09-20 18:32:06 +03:00
Zach Read c3597ac4dd Allow X509Chain to replace the root trust list when building a chain
This enables users of X509Chain to specify a priori a set of trusted root authorities, which is used in place of the default root authorities.

By explicitly specifying the root authorities the caller enables revocation checking for normally untrusted roots, and simplifies the certificate acceptance by having the chain engine tell them if the root matched, vs doing a post-build check (in the case of cross-certified authorities this even tells the chain engine which path to prefer).

Commit migrated from https://github.com/dotnet/corefx/commit/e70e76159b3f34e4e35d241daf39d4f57f4bd82c
2019-09-18 08:31:26 -07:00
Stephen Toub df771c4e0b Remove unused files from System.Net.Http (dotnet/corefx#41155)
Commit migrated from https://github.com/dotnet/corefx/commit/e9836aa6bdd40d76d8cf3534e491d90421c4bd9a
2019-09-17 17:17:49 +03:00
Stephen ToubandJan Kotas 78d665b987 Remove System.Net.Http dependency on System.Text.RegularExpressions (dotnet/corefx#41110)
* Remove System.Net.Http dependency on System.Text.RegularExpressions

This dependency is the only reason we end up with a 105K System.Text.RegularExpressions.dll as part of a trimmed new MVC app.  Regex is used in the case where on Windows a bypass list is provided, in which case each item in the list is changed into a regex, which is then evaluated against each url provided to SocketsHttpHandler.  But the patterns usable are simple: the only special character recognized is an asterisk, which can map to zero or more of any character.  So, we can instead employ a simple processor for such patterns, which then eliminates the need to reference System.Text.RegularExpressions.dll from System.Net.Http.dll.  It also happens to be faster.

* Address PR feedback

* Update src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpWindowsProxy.cs

Co-Authored-By: Jan Kotas <[email protected]>


Commit migrated from https://github.com/dotnet/corefx/commit/0e65e923689962f9634b5948d15f995140cc7c93
2019-09-16 14:56:59 -04:00
David Shulman 6e990fd4ca Disable NoCallback_RevokedCertificate_NoRevocationChecking_Succeeds (dotnet/corefx#41109)
The remote server "revoked.badssl.com" has a certificate which is not only revoked but also
now untrusted since it has expired.

Disabling test for now

Contributes to dotnet/corefx#41108

Commit migrated from https://github.com/dotnet/corefx/commit/8350134a21960df364517c9c766937ae47bf76c5
2019-09-14 08:50:30 -07:00
Tomas Weinfurt 4b7edb6003 use configuration for invalid host name (dotnet/corefx#41083)
Commit migrated from https://github.com/dotnet/corefx/commit/19ea63fee517327e1f6fbfa730300ddef5ef8a3b
2019-09-13 09:40:36 -04:00
Tomas Weinfurt 4702304395 improve two http2 tests (dotnet/corefx#40797)
Commit migrated from https://github.com/dotnet/corefx/commit/9eed67227c2d0766c1b7fe40fa8a1a97097e3beb
2019-09-11 12:16:01 -07:00
Viktor Hofer d5079dda17 Remove ProjectGUIDs from project files and Project and Name attributes from P2Ps (dotnet/corefx#40926)
* Remove ProjectGUIDs from P2Ps

* Remove ProjectGUIDs from project files

Commit migrated from https://github.com/dotnet/corefx/commit/c22714d65151968a17c3b232748880d5e7961dee
2019-09-09 18:21:25 +02:00
Viktor Hofer f1426468d4 Disable two networking tests on UAP (dotnet/corefx#40875)
* Disable timeout sensitive networking test on UAP

Disabling GetAsync_CancelPendingRequests_DoesntCancelReadAsyncOnResponseStream on UAP

* Update HttpClientHandlerTest.Cancellation.cs


Commit migrated from https://github.com/dotnet/corefx/commit/9161098ade5075a8c126b2d7eb98abbeadff2961
2019-09-06 09:42:03 -07:00
Tomas Weinfurt 5fb317f553 use type for Http2LoopbackServer.CreateServer (dotnet/corefx#40863)
Commit migrated from https://github.com/dotnet/corefx/commit/b46ebcb9a2408f9826c103ce6b340b419d948512
2019-09-05 21:27:05 -07:00
Tomas Weinfurt 8278bf8670 update SendAsync_ConcurentSendReceive_Ok to use DuplexContent (dotnet/corefx#40858)
Commit migrated from https://github.com/dotnet/corefx/commit/88017f967529d30272ad75028e5538f35087e451
2019-09-05 16:49:16 -07:00
Cory Nelson b0c6eb77cd Support PAC scripts that return multiple proxies (dotnet/corefx#40082)
* Support PAC scripts that return multiple proxies.

Resolves dotnet/corefx#39370 

Commit migrated from https://github.com/dotnet/corefx/commit/5e97c2b50ac2b18909606ce3ea14c3e7e61db7e8
2019-09-05 02:11:47 -07:00
Tomas Weinfurt c4efc1dafd fix more tests to work with http2 (dotnet/corefx#39019)
* fix cancelation tests to work with http2

* fix more tests and feedback from review

* feedback from review

* fix issues with missing connection: close

* update body check

* feedback from review

* fix resolve

* feedback from review


Commit migrated from https://github.com/dotnet/corefx/commit/5108d9245b891deeb36a164f434f4fb6975c8baf
2019-09-04 16:48:34 -07:00
Stephen Toub 11f952306a Remove readonly from two GCHandle fields (dotnet/corefx#40807)
Due to the `readonly`, the mutations performed by `Free` will be done on a copy rather than on the data stored in the field.

Commit migrated from https://github.com/dotnet/corefx/commit/437ce88edeb835e1dbe94c6d418b6169b69745fb
2019-09-04 17:46:09 -04:00
Tomas Weinfurt c363e029ea replace CRLF with Environment.NewLine where appropriate (dotnet/corefx#40723)
* replace CRLF with Environment.NewLine where appropriate

* use sb.AppendLine

* fix more unit tests


Commit migrated from https://github.com/dotnet/corefx/commit/a6e7ffd72db078a46612afa9d085bd27ef8e2fed
2019-09-03 22:34:24 -04:00
Tomas Weinfurt efe32d48a8 surface _abortException (dotnet/corefx#40785)
Commit migrated from https://github.com/dotnet/corefx/commit/bc7e561e28839c56f7465f3382d5f60716a34bab
2019-09-03 22:11:43 -04:00
Stephen Toub f08a1c9c9b Pass a CancellationToken in a few more places (dotnet/corefx#40715)
Most of these to WaitAsync shouldn't actually matter, as the semaphores being used are there for corner cases or to protect erroneous usage, but if there's no contention, passing a token won't hurt, and if there is contention, passing the token makes it more robust.

Commit migrated from https://github.com/dotnet/corefx/commit/14a7adb23569363b94d575d64b7cb1f38cda3e4a
2019-09-03 15:24:08 -04:00
Eirik Tsarpalis ea60c15a90 Httpstress: Add more checksum validations & expose Kestrel Http2 limits configuration (dotnet/corefx#40708)
Httpstress: Add more checksum validations & expose Kestrel Http2 limits configuration

Commit migrated from https://github.com/dotnet/corefx/commit/a64e40535283d6470c2909c8f08b178454a8718b
2019-08-30 23:14:49 +02:00
Stephen Toub 4fc5d8971d Contribute to IDE0055 (fix formatting)
Commit migrated from https://github.com/dotnet/corefx/commit/b49a8a9be1d53cd9e50cb68fd8540be25c65d433
2019-08-24 07:47:35 -04:00
Stephen Toub 7bdae2162f Contribute to StyleCop SA1002 (semicolon spacing)
However, I'm not enabling the rule permanently, as it disagrees with VS IDE0055 about the spacing around semicolons at the end of empty while and for loops.

Because this also impacts `for (;;)` loops, I also searched and replaced those with `while (true)`, to standardize on that across the codebase.


Commit migrated from https://github.com/dotnet/corefx/commit/93285e4511a9656a30b92b8b6a9088608aac40e0
2019-08-24 07:47:35 -04:00
Stephen Toub bfa8c26dcb Fix StyleCop warning SA1001 (spaces around commas)
Commit migrated from https://github.com/dotnet/corefx/commit/37f351d310f07560274c63862ceaed8afd54a46f
2019-08-24 07:47:35 -04:00
Eirik Tsarpalis 2077e8783b Httpstress: Add checksum validation & support plaintext http (dotnet/corefx#40360)
Httpstress: Add checksum validation & support plaintext http

Commit migrated from https://github.com/dotnet/corefx/commit/a25beeee0af0c849eef58c45579733efa0d55f8d
2019-08-22 21:55:04 +01:00
Eirik Tsarpalis 6379ad84d3 HTTP2: fix header corruption issue (dotnet/corefx#40487)
* HTTP2: fix header corruption issue

Fixes a bug in HPackEncoder which results in header
data corruption in cases where the write buffer has
not been zeroed out. Adds HPack roundtrip tests.
Fixes dotnet/corefx#40459.

Commit migrated from https://github.com/dotnet/corefx/commit/6f9796080563c9c40359e641e3287fabe42b580c
2019-08-22 21:49:07 +01:00