Addresses https://github.com/dotnet/runtime/issues/1980
* [xunit tests][mono] Remove disabled Microsoft.VisualBasic.Core.Tests tests from rsp file.
* [xunit tests][mono] Remove System.Collections.Specialized.Tests.Ctor_NegativeCapacity_ThrowsArgumentOutOfRangeException from rsp file
* Remove System.Collections.Concurrent.Tests.ConcurrentQueueTests.ReferenceTypes_NulledAfterDequeue from rsp file because it passes on release mono
* Remove BasicEventSourceTests.TestsManifestNegative.Test_GenerateManifest_InvalidEventSources from rsp file because it passes locally
* Remove ManagedTests.DynamicCSharp.Conformance.dynamic.overloadResolution.Methods.Oneclass2methods.twoprms004.twoprms004.Test.DynamicCSharpRunTest from rsp file
* Remove System.IO.Tests.*.CopyFileWithData_MemberData from rsp file
* Move a set of skipped System.Linq.Expressions.Tests out of rsp file.
* Annotate System.Collections.Concurrent.Tests.ConcurrentQueueTests.ReferenceTypes_NulledAfterDequeue with ActiveIssue attribute
* Move another set of skipped System.Linq.Expressions.Tests out of rsp file.
* Move skipped System.Linq.Parallel.Tests.PlinqModesTests.WithExecutionMode_Multiple test out of rsp file
* Move skipped System.Memory.Tests out of rsp file
* Move skipped System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandler.* tests out of rdp file
* Remove System.Net.Sockets.Tests.SocketOptionNameTest.MulticastInterface_Set_AnyInterface_Succeeds because it passes locally.
* Move System.Reflection tests with an active issue out of rsp file
* Move skipped System.Runtime.InteropServices.Tests out of rsp file
* Replace closed CoreFX GH issue with the active Runtime one
* Move skipped System.Runtime.Serialization.Formatters.Tests out of rsp file
* Move skipped System.Runtime.Tests with an active issue out of rsp file
* Move skipped System.Threading.Tests with an active issue out of rsp file
* Remove skipped System.Data.Common.Tests because the related issue was addressed
* Move skipped System.Data.Common.Tests.DbConnectionTests.ProviderFactoryTest with an active issue out of rsp file
* Move skipped System.Diagnostics.StackTrace.Tests with an active issue out of rsp file
* Move skipped System.Numerics.Vectors.Tests with an active issue out of rsp file
* Move skipped System.Reflection.Context.Tests with an active issue out of rsp file
* Move skipped System.Threading.ThreadPools.Tests.ThreadPoolTests.SetMinMaxThreadsTest with an active issue out of rsp
* Move skipped System.ComponentModel.Composition and Tests.Integration namespaces with an active issue out of rsp file
* Update a message in skipped System.Runtime.InteropServices.Tests
* Move skipped System.Reflection.Tests.MetadataTokenTests.SuccessImpliesNonNilWithCorrectTable with an active issue out of rsp file
* Move skipped/no repro System.Threading.Overlapped.Tests with an active issue out of rsp file
* Move skipped System.Runtime.Extensions with an active issue out of rsp file
* Re-enable skipped System.Runtime.Handles.Tests because the related issue was addressed
* Move skipped System.Reflection.TypeExtensions.Tests with an active issue out of rsp file
* Move skipped System.Reflection.Emit.Lightweight.Tests with an active issue out of rsp file
* Move skipped System.Reflection.MetadataLoadContext.Tests with an active issue out of rsp file
* Move skipped System.Xml.Xsl.XslTransformApi.Tests with an active issue out of rsp file
* Move skipped System.Security.Cryptography.Encoding.Tests with an active issue out of rsp file
* Move System.Drawing.Imaging.Tests.ImageAttributesTests.SetColorMatrix_InvalidFlags_ThrowsArgumentException out of rsp file
* Add an active issue attribute to System.Drawing.Imaging.Tests.ImageAttributesTests.SetColorMatrix_InvalidFlags_ThrowsArgumentException test; add a comment about libgdiplus dependency to PlatformDetection.IsDrawingSupported method.
* Move System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandler_ClientCertificates_Test.AutomaticOrManual_DoesntFailRegardlessOfWhetherClientCertsAreAvailable out of rsp because it has an active corefx issue; see https://github.com/dotnet/corefx/issues/37336
* Remove System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandler_DangerousAcceptAllCertificatesValidator_Test.SetDelegate_ConnectionSucceeds from rsp because it's already disabled as part of system.net.* tests; see https://github.com/dotnet/runtime/pull/2318
* Move skipped System.Reflection.Emit.ILGeneration.Tests with an active issue out of rsp file
* Move skipped System.Reflection.Emit.Tests with an active issue out of rsp file
* Remove skipped System.Reflection.Tests from rsp file because they pass locally
* Try to re-enabled skipped System.Reflection.Tests.AssemblyTests.LoadFromStream_Location_IsEmpty
* Remove broken namespace
* Add an active issue to System.Reflection.Tests.AssemblyTests.LoadFromStream_Location_IsEmpty
* Add an active issue to several System.Reflection tests
* Remove skipped System.Tests.ExitCodeTests.SigTermExitCode because it passes locally.
* Remove skipped System.Tests.Types.VoidTests.IsByRef_Get_ReturnsExpected from rsp file because it passes locally
* Remove skipped System.Tests.GCTests.LatencyRoundtrips from rsp file because it passes locally
* Remove skipped System.Tests.GCExtendedTests.GetGCMemoryInfo from rsp-file because the related functionality has been implemented (see https://github.com/mono/mono/issues/15236)
* Remove skipped System.Tests.GetEnvironmentVariable.EnvironmentVariablesAreHashtable from rsp file because it passes locally
* Turn System.Threading.Tasks.Tests.ExecutionContextFlowTest.TaskCompletionSourceDoesntCaptureExecutionContext into a conditional theory because it requires precise GC
* Try to re-enable System.Threading.Tasks.Tests.TaskContinueWithTests.LongContinuationChain_ContinueWith_DoesNotStackOverflow
* Remove skipped System.Threading.ThreadPools.Tests.ThreadPoolTests.SetMinThreadsTo0Test from rsp file because it passes locally
* Remove System.Threading.ThreadPools.Tests.ThreadPoolTests.SetMinMaxThreadsTest_ChangedInDotNetCore from rsp file because it's explicitly skipped on Mono using SkipOnTargetFramework attribute
* Add an active issue to System.Tests.ExitCodeTests.SigTermExitCode and System.Tests.GCTests.LatencyRoundtrips tests
* Remove skipped System.Data.Tests.SqlTypes.SqlCharsTest.ReadWriteXmlTest from rsp file because it passes locally
* Add an active issue to System.Tests.GCExtendedTests.GetGCMemoryInfo because it fails on helix
* Add an active issue
* Add an active issue
* Re-add an active issue to System.Tests.ExceptionTests.ThrowStatementDoesNotResetExceptionStackLineOtherMethod
* Move skipped System.ComponentModel.Composition.MetadataViewProviderTests.GetMetadataView_InterfaceWithIndexer_ShouldThrowNotSupportedException with an active issue out of rsp file (see https://github.com/mono/mono/issues/15169)
* Remove skipped Tests.Integration.ExportFactoryTests.ExportFactoryStandardImports_ShouldWorkProperly from rsp file because it's already disabled within the entire Tests.Integration.ExportFactoryTests class (see https://github.com/mono/mono/issues/16417)
* Remove several skipped System.ComponentModel.Composition.Tests from rsp file because they pass locally.
* Move skipped System.ComponentModel.Composition.ExportCollectionTests.ImportCollectionsFromContainerOnly with an active issue out of rsp file
* Move skipped System.Diagnostics.Tests.StackTraceTests.Ctor_Exception_SkipFrames and System.Diagnostics.Tests.StackTraceTests.Ctor_Exception_SkipFrames_FNeedFileInfo tests with an active issue out of rsp file.
* Move skipped System.Diagnostics.Tests.StackTraceTests.ToString_Invoke_ReturnsExpected with an active issue out of rsp file
* Remove skipped System.Reflection.Tests.MetadataLoadContextTests.RelocatableAssembly from rsp file because it passes locally.
* Move skipped System.Runtime.Loader.Tests.RefEmitLoadContextTests.LoadRefEmitAssembly with an active issue out of rsp file
* Moved skipped ThreadPoolBoundHandleTests.PreAllocatedOverlapped_NullAsCallback_ThrowsArgumentNullException with an active issue out of rsp file (see https://github.com/mono/mono/issues/15313)
* Move skipped System.Runtime.Tests.ProfileOptimizationTest.ProfileOptimization_CheckFileExists with an active issue out of rsp file
* Move skipped System.Reflection.Emit.Tests.DynamicILInfoTests with an active issue out of rsp file
* Move skipped System.Reflection.Emit.Tests.DynamicILInfoTests.SetX_NullInput_ThrowsArgumentNullException and System.Reflection.Emit.Tests.DynamicMethodctor1.InvalidOwner_ThrowsArgumentException with an active issue out of rsp file
* Add an active issue to System.Threading.Tasks.Tests.TaskContinueWithTests.LongContinuationChain_ContinueWith_DoesNotStackOverflow because it's flaky
* Add an active issue to Tests.Integration.DiscoveryTests.DiscoverAddinsWithCombinedCustomExportAndMetadataAttribute
* Add an active issue to System.Threading.ThreadPools.Tests.ThreadPoolTests.SetMinMaxThreadsTest_ChangedInDotNetCore
* Add an active issue to System.ComponentModel.Composition.MetadataAttributeTests.StronglyTypedStructureTestWithTransparentViews
* Replace TargetFrameworkMonikers.Mono with TestRuntimes.Mono
* Remove redundant space
* Remove all -notrait category
* Add an active issue to System.ComponentModel.Composition.MetadataAttributeTests.StronglyTypedStructureTest
* Add an active issue to System.ComponentModel.Composition.CompositionContainerTests.GetExportOfTTMetadataView1_TypeAsMetadataViewTypeArgument_IsUsedAsMetadataConstraint
* Disable the whole System.ComponentModel.Composition.Tests namespace
* Move some System.Runtime.Loader.Tests, which rely on collectible AssemblyLoadContext, out of rsp file
* Remove three System.Runtime.Loader.Tests.AssemblyLoadContextTest tests with no local failures from rsp file
* Remove System.Runtime.Loader.Tests.DefaultLoadContextTests.LoadNonExistentInDefaultContext and System.Runtime.Loader.Tests.DefaultLoadContextTests.LoadInDefaultContext from rsp file because the related issues should be addressed
* Add an active issue to System.Runtime.Loader.Tests.DefaultLoadContextTests.LoadNonExistentInDefaultContext and System.Runtime.Loader.Tests.DefaultLoadContextTests.LoadInDefaultContext because they fail on CI
* Move several System.Runtime.Loader.Tests.AssemblyLoadContextTest with an active issues out of rsp file
* Remove System.Utf8String.Experimental.Tests from rsp file to verify how they behave on CI
* Clean up rsp file to check all remaining failures
* Skip the entire System.ComponentModel.Composition.Registration.Tests namespace on Mono
* Disable a set of classes in System.Utf8String.Experimental.Tests workspace.
* Add stubs for Utf8String and Utf8Span.cs classes to fix the test build on Mono
* Remove nint/nunit aliases unused in PNSE version of Utf8Span
* Remove CoreFX.issues.rsp file because it has been cleaned up
Update generic tests to use a Version rather than boolean IsHttp11/IsHttp20, and update some HTTP/2 to work for HTTP/3.
Enable tests for HTTP/3, behind a conditional feature test.
Fix QPackDecoder lzcnt assuming an 8-bit test.
Rename test QPACK classes from QPackEncoder/QPackDecoder -> QPackTestEncoder/QPackTestDecoder to avoid naming confusion with product code classes.
Fix QPackTestDecoder bit flag checks.
Fix a double call to QuicConnection.CloseAsync(). Update to shutdown QuicConnection in a background task.
Fix test cert usage.
* libraries -restore for vertical build without test restore
* Automatic test change and regex to remove the addition of an extra line at eof
* manual test restore fixed (restore completely done for vertical build)
* build native done
* Automatic ref change and regex to remove the last line
* manual reference assebly change and generated shims build
* automatic src change and regex
* native bin place and src build manual change
* apicompat and pretest.csproj done
* fixing the package build
* fixing all config
* packaging and feedback
* adding back placeholder configuration
* fixing the shims
* delete configuration.props
* making the build work in master
* Test Change
* fixing the packageing, test restore replacing TargetFramework -> OriginalTargetFramework
* delete test configuraiton.props, trailing semicolon and use targetFramework
* reverting the package change
* enable apicompat and fixing configurationGroup for individual projects
* fixing the api compat
* making ilproj work
* adding the outerBuildTest
* adding the arcade package version
* fixing the merge conflicts
* minor changes
* adding additional configs and setting the runtimeOS
* making the vs stuff work
* removing the target Group to fix the apicompat
* fixing the linux build and some minor changes
* making additionalBuildTargetFramework LOcalProperty
* fixing the allConfigurations build
* fixing the netfx build
* fixing package Testing and restore
* Missing TargetFrameworks tag
* making the VSdesgin stuff work
* Remove OriginalFramework Entirely
* some minor pr feedback
* RemoveExtraSemicolon
* use boolean exclude flag
* fixing yml scripts to pass tests
* adding comments and some minor feedback
* moving packaging property to correct plave
* fixing the build for web assembly
* Fixing the live ci build
* Fixing the live build for shims
* fixing the tests
* fixing the packaging and enterprise linux
* fixing package sizes
* Fix the targetFramework
* updating the targetFramework sdl
* removing the buildOS and be able to use OSGroup as done in the old system
* Fixing the osgroup stuff for send to helix task
* Fix OSX failures
* Fixing the osx build
* uploading tmp folder to artifacts
* running restore for runtime.deproj correctly
The tests used by PlatformHandlerTest moved to Common/tests in order to share them between System.Net.Http and System.Net.Http.WinHttpHandler.
The added conditions correspond to the state before WinHttpHandler removal. They're just based on IsWinHttpHandler instead of UseSocketHandler.
Some of the code must be conditionally compiled since there is no usable common base class for HttpClientHandler and WinHttpHandler. Other issues solved by introducing WinHttpClientHandler for testing purposes. It corresponds to HttpClientHandler.Windows.cs code from before its removal.
* Address more issue numbers in the code
Replaced a bunch of unadorned issue numbers with links, so we know which repo the issue is for. In some cases the repo was named, but for consistency I still replaced it with a link.
In some cases, in particular where the issue had been closed saying effectively "we're not going to do anything here", I removed TODOs and the associated issue numbers.
In a few cases, the TODO and issue number was to say "we should do X when Y is fixed", so I did X since Y was fixed.
* Apply suggestions from code review
Co-Authored-By: Jan Kotas <[email protected]>
* Address PR feedback
* Fix OrderedEnumerable by using MemoryExtensions.Sort
Co-authored-by: Jan Kotas <[email protected]>
* Implement HttpContent and HttpClient cancellation APIs
Implements APIs approved in dotnet/corefx#32615 and dotnet/runtime#576
* Use new CreateContentReadStreamAsync overload in MultipartContent
* Expose HttpContent.SerializeToStreamAsync overload with cancellation
* Remove HTTP_DLL preprocessor directives
* Rename WIN_HTTP_HANDLER to WINHTTPHANDLER_DLL
* Use more 'var' where type is obvious
* netcoreapp -> netcoreapp5.0 in .sln files
* netcoreapp; -> netcoreapp5.0; , netcoreapp- to netcoreapp5.0-
* netcoreapp- -> netcoreapp5.0 in .csproj
* 'netcoreapp -> 'netcoreapp5.0 in .csproj
* done with libraries sub folder
* missed semicolon
* minor changes
* netcoreapp -> netcoreapp5.0 in some extra files
* vNext target variable in configurations.props
* netcoreapp => netcoreapp5/0 in some other .props file
* netcoreapp -> vnext in .csproj
* making the netcorepap framework switch work
* fixing sendToHelix and linux build
* TargetFrameworkVNext -> netcoreappCurrent
* case correct netcoreappcurrent
* fixing send to helix zip path
* netfx -> net472 in .sln
* netfx; -> net472; in .props
* netfx- -> net472- in .props
* netfx - -> net472- in .csproj
* 'netfx-> 'net472 in .csproj
* netfx -> net472 manual change
* fixing ci build for netfx
* Not trying to change the global property
* Fixing build failure due to master changes in net https tests
* adding documentaiton and fixing filtering
* netcoreapp -> netcore5.0 in py file
* changing the path to use netcoreapp5.0 version
* feedback and override corefx path corrected in installers
* remaing netcoreapp5.0 changes done
* netcoreapp-> netcoreapp5.0 after live builds
* net472 -> netframeworkcurrent
* Fix test build break and update common path usages to use property
* Use normalize directory for CommonPath and CommonTestPath
* Update instances of CommonPath and CommonTestPath to not use trailing \
* 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
Mechanical/automated change. The only manual changes were a) removing the two rules from the CodeAnalysis.ruleset file, b) removing spaces from one line of a .targets file that is used to generate a .cs file, and c) reverting the changes in a few test files where the naive replacement happened in the middle of a verbatim string where the whitespace actually mattered.
Commit migrated from https://github.com/dotnet/corefx/commit/09a6e66b0c2b31bd0f6e7e3170537d14027aeed0
* Remove some unused locals
Trying out various analyzers, including one to flag unused locals. There are more than this, but this is a first batch. Some of these are just clean-up. Others are saving unnecessary cost. At least one appears to be a real functional bug.
* Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/545d9959aebded62a26d20c7c1bf86785a92e52a
* Replace "Assert.Equal(true, " with "Assert.True("
* Replace "Assert.Equal(false, " with "Assert.False("
And fix a few Assert.Equal(true cases that deal with objects and thus need to be reverted.
* Replace "Assert.StrictEqual(true, " with "Assert.True("
* Revert a few changes where true/false was being compared to object
* Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/1296bc8386a7283e319ddf723282f16651f9ea5f
* Ensure that CancellationToken is propagated to built-in request content types
We don't currently expose the overload that would allow CancellationToken to be accessed by HttpContent-derived types in general, but we can at least ensure that when using the built-in content types, the CancellationToken provided to SendAsync is appropriately threaded through. We were doing this previously in only a few cases, where we knew that the previous overload wouldn't be overridden (namely internal types and sealed types), but we can enable the 90% scenario as well by doing a type check at run-time.
* Disable cancellation test for UAP handler
Commit migrated from https://github.com/dotnet/corefx/commit/450f49a1a80663529b31d3defafbd5e59822a16a
SocketsHttpHandler doesn't own the proxy its given; the lifetime of that proxy is up to the developer supplying it. We may also end up using a global proxy instance if the developer hasn't explicitly supplied one. However, SocketsHttpHandler's internal HttpConnectionPoolManager was disposing of this proxy instance on its disposal. For proxies that implement IDisposable, as our global default proxy does, that can be very problematic; on Windows, our default proxy has a SafeHandle, and once its disposed, every subsequent request to the proxy will fail (an exception gets thrown and then internally eaten). The fix is simply to stop disposing a proxy instance we don't own.
While investigating this, I also made a few style tweaks to WinInetProxyHelper, removing private property setters, so as to better be able to see that certain values were readonly and never changed after construction.
Commit migrated from https://github.com/dotnet/corefx/commit/c6a849b8d24fc48bb0bbdb9f9165752a4a19459b
* Making Exceptions serializable
* Remove EventLog serialization exceptions from tests since they won't work on non-Windows platforms
* Fix build and add internal exceptions as well
* Add parameter-less constructor to RethrowException
* Adding PR Feedback
* Fix allConfigurations build
Commit migrated from https://github.com/dotnet/corefx/commit/7075587321a1b6b59248b1a6c7ea04fc803eab96
* Log exceptions from asynchronously failing Expect: 100-continue sends
When Expect: 100-continue is used, the sending of the request body content is allowed to run concurrently with the receipt of the response headers. If the processing of the response headers encounters an exception, we currently fail to ever join with that send task, which results in a TaskScheduler.UnobservedTaskException event. This PR changes to observe the exception in such cases and log it.
(In doing so, I also came across an async void method, and changed all of the remaining ones in the assembly to be async Task instead. The current implementation of async void isn't any cheaper than async Task, and is actually more expensive in certain ways, plus it unnecessarily interacts with any SynchronizationContext that may exist.)
* Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/0bc3ee4a4f1debaa0dd3c957d5201ae2a47757a1
This PR implements the new static HttpClient.DefaultProxy property which was approved
during API review.
Modify the SystemProxyInfo.ConstructSystemProxy method to a Singleton.
Modify SocketsHttpHandler to use the HttpClient.DefaultProxy property.
Rename the HttpSystemProxy class to HttpWindowsProxy.
Add some HttpClient tests for the new property.
Closesdotnet/corefx#36553
Commit migrated from https://github.com/dotnet/corefx/commit/c661db6ce2da91033671c0000afc185de1ad3fe9
SocketsHttpHandler was not using the proxy bypass list specified in IE settings in cases where
there is a combination of both 'AutoDetect' and 'Manual' settings in the IE settings dialog.
SocketsHttpHandler uses WinHttpHandler's WinInetProxyHelper class as part of the HttpSystemProxy
class. But it was consuming it in an incorrect way. WinInetProxyHelper was originally written to
be used only with the rest of the WinHTTP stack for WinHttpHandler. When WinHTTP GetProxyForUrl() was returning a ProxyBypass string, HttpSystemProxy was ignoring it. It was
assuming that the string for Proxy was correct. But in cases where ProxyBypass is returned, the
Proxy string is only used if the destination uri doesn't match any of the strings in the ProxyBypass
list. That logic would normally be handled automatically by WinHttpHandler. But HttpSystemProxy
was simply discarding the ProxyBypass string returned by WinHTTP GetProxyForUrl().
In order to address this fix, I added new tests for HttpSystemProxy. I utilized the existing mock
layers for registry and WinHTTP interop that are contained in the WinHttpHandler Unit Tests. It might
seem weird to have tests for the internal HttpSystemProxy class located in the WinHttpHandler folder.
But, we already pull in the source code for WinInetProxyHelper from WinHttpHandler into the
SocketsHttpHandler compilation. Using these Unit Tests with the mocking layers allows us to test a
broad range of scenarios (registry settings and network failures) that are normally difficult to test.
I have a plan, though, to refactor the system proxy code and tests as part of implementing dotnet/corefx#36553.
That will result in the system proxy code and tests ending up in a more logical place.
Fixesdotnet/corefx#33866
Commit migrated from https://github.com/dotnet/corefx/commit/6da9a3b80c2ac56c641fa22157607860f6b9387f