platform/upstream/dotnet/runtime.git
5 years agoDisable PostAsyncExpect100Continue_FailsAfterContentSendStarted_Throws on non-Sockets...
Stephen Toub [Thu, 9 May 2019 21:24:31 +0000 (17:24 -0400)]
Disable PostAsyncExpect100Continue_FailsAfterContentSendStarted_Throws on non-SocketsHttpHandler (dotnet/corefx#37553)

Commit migrated from https://github.com/dotnet/corefx/commit/a010364670e9a5a8df39d3d7eac97f0e129aaaa1

5 years agoTweak SendRecv_NoBuffering_Success test to gather more details (dotnet/corefx#37555)
Stephen Toub [Thu, 9 May 2019 20:20:20 +0000 (16:20 -0400)]
Tweak SendRecv_NoBuffering_Success test to gather more details (dotnet/corefx#37555)

The test failed from the `Assert.Equal(sendBuffer.Length, totalReceived)` with `totalReceived == 0`.  The only way that should happen, short of buggy product code, is if somehow the connection was torn down from the client side such that the server side read 0 bytes.  Under the theory that maybe that was somehow caused by the send operation failing, we should wait on the send task from the client before doing the assert.

Commit migrated from https://github.com/dotnet/corefx/commit/25bf7f0654a8e35cc47ccc7ee7cb80e49c748e03

5 years agoRemove unnecessary string allocation from ZipFileUtils (dotnet/corefx#37546)
Stephen Toub [Thu, 9 May 2019 19:39:39 +0000 (15:39 -0400)]
Remove unnecessary string allocation from ZipFileUtils (dotnet/corefx#37546)

Commit migrated from https://github.com/dotnet/corefx/commit/5cc736198cd5d1663a4af6c4e31cccf06ab3735d

5 years agoAdd TaskAsyncEnumerableExtensions to Microsoft.Bcl.AsyncInterfaces (dotnet/corefx...
Stephen Toub [Thu, 9 May 2019 18:33:20 +0000 (14:33 -0400)]
Add TaskAsyncEnumerableExtensions to Microsoft.Bcl.AsyncInterfaces (dotnet/corefx#37379)

* Add TaskAsyncEnumerableExtensions to Microsoft.Bcl.AsyncInterfaces

* Adding baseline entry for the missing type on netstandard

* Temporarily changing test configurations of AsyncInterfaces package so that all types are found.

* Comment out AsyncEnumerable tests while the type makes its way to netstandard 2.1

Commit migrated from https://github.com/dotnet/corefx/commit/2392caee7354520d4f7c9663c052fa46d8b1fe10

5 years agoUpdate ProjectNTfs, ProjectNTfsTestILC to beta-27709-00, beta-27709-00, respectively...
dotnet-maestro-bot [Thu, 9 May 2019 16:59:09 +0000 (09:59 -0700)]
Update ProjectNTfs, ProjectNTfsTestILC to beta-27709-00, beta-27709-00, respectively (dotnet/corefx#37535)

Commit migrated from https://github.com/dotnet/corefx/commit/4d6eaf802016395ff6a21a1f62d0d1353fb0d9a0

5 years agoMake ZipFileUtils use of ArrayPool more reliable (dotnet/corefx#37547)
Stephen Toub [Thu, 9 May 2019 16:55:15 +0000 (12:55 -0400)]
Make ZipFileUtils use of ArrayPool more reliable (dotnet/corefx#37547)

If the Rent call tried to allocate and OOM'd, we would end up returning the same buffer to the pool twice, once here and once in the caller's finally.

Commit migrated from https://github.com/dotnet/corefx/commit/a11f11a669865a07d8d6755a5ae3348c3a073e47

5 years agoUse better Array.Copy overload (dotnet/corefx#37548)
Stephen Toub [Thu, 9 May 2019 16:43:45 +0000 (12:43 -0400)]
Use better Array.Copy overload (dotnet/corefx#37548)

Just a little cleanup.  When we're working with T[]s, use Array.Copy that takes a lower bound, explicitly passing in 0, rather than forcing the implementation to query GetLowerBound() on each array.

Commit migrated from https://github.com/dotnet/corefx/commit/e72c6c53baddb02a630e8e6592a59d89e30b856b

5 years agoAdds more OleDb tests (dotnet/corefx#37509)
Maryam Ariyan [Thu, 9 May 2019 11:04:55 +0000 (04:04 -0700)]
Adds more OleDb tests (dotnet/corefx#37509)

Commit migrated from https://github.com/dotnet/corefx/commit/3070e0484558aaaaf3547ede2f285544d0a3ed00

5 years ago[master] Update dependencies from dotnet/coreclr (dotnet/corefx#37514)
dotnet-maestro[bot] [Thu, 9 May 2019 11:03:22 +0000 (07:03 -0400)]
[master] Update dependencies from dotnet/coreclr (dotnet/corefx#37514)

* Update dependencies from https://github.com/dotnet/coreclr build 20190507.72

- Microsoft.NET.Sdk.IL - 3.0.0-preview6-27707-72
- Microsoft.NETCore.ILAsm - 3.0.0-preview6-27707-72
- Microsoft.NETCore.Runtime.CoreCLR - 3.0.0-preview6-27707-72

* Update Microsoft.DotNet.XUnitConsoleRunner

We need the fix which removes STAThread from the main routine of
xunit.console.

* Clean up the baseline for DiagnosticCounter

* Update test baseline.

Commit migrated from https://github.com/dotnet/corefx/commit/5640cde41c872e03e6a8a751fac5092e3c68b2c6

5 years agoExpose and test APIs for some threading metrics (CoreFX) (dotnet/corefx#37401)
Koundinya Veluri [Thu, 9 May 2019 10:44:39 +0000 (03:44 -0700)]
Expose and test APIs for some threading metrics (CoreFX) (dotnet/corefx#37401)

* Expose and test APIs for some threading metrics (CoreFX)

- API review: https://github.com/dotnet/corefx/issues/35500
- Depends on https://github.com/dotnet/coreclr/pull/22754, https://github.com/dotnet/corert/pull/7066

* Separate and expose pending local vs global work item count

* Remove local/global variants of PendingWorkItemCount

* Remove unrelated test

* Add test for a fix to ThreadLocal.Values property throwing NullReferenceException when disposed

Fix is in https://github.com/dotnet/corert/pull/7066

* Fix build

* Fix test

* Add API compat baselines for uapaot

* Fix test

* Use RemoteExecutor for MetricsTest

* Address feedback

Commit migrated from https://github.com/dotnet/corefx/commit/34fe566b6f6bd739a876e7e1dc48cf631647e5d7

5 years agoSuppress NullableAttribute reverse API compat warnings
Stephen Toub [Wed, 8 May 2019 21:26:44 +0000 (17:26 -0400)]
Suppress NullableAttribute reverse API compat warnings

Commit migrated from https://github.com/dotnet/corefx/commit/cbb62e0e6ebdb10d5b2c6badb9245b4d28120131

5 years agoNullable: System.Collections.dll
Stephen Toub [Thu, 2 May 2019 02:39:24 +0000 (22:39 -0400)]
Nullable: System.Collections.dll

Commit migrated from https://github.com/dotnet/corefx/commit/a18f321e75b0e7572c9a67bb7951b549dbd42c9e

5 years agoNullable: System.Collections.Concurrent.dll
Stephen Toub [Thu, 18 Apr 2019 02:42:16 +0000 (22:42 -0400)]
Nullable: System.Collections.Concurrent.dll

Commit migrated from https://github.com/dotnet/corefx/commit/9cf92cbef7cf5fcf46a1b556f9c6250e67d421ab

5 years agoNullable: System.Diagnostics.StackTrace.dll
Stephen Toub [Thu, 18 Apr 2019 02:11:11 +0000 (22:11 -0400)]
Nullable: System.Diagnostics.StackTrace.dll

Commit migrated from https://github.com/dotnet/corefx/commit/0c9b71cda7e14cdbac387750458280eabfb5bc23

5 years agoNullable: System.Numerics.Vectors.dll
Stephen Toub [Thu, 18 Apr 2019 01:54:15 +0000 (21:54 -0400)]
Nullable: System.Numerics.Vectors.dll

Commit migrated from https://github.com/dotnet/corefx/commit/d5cf97fcf466f45e2a7dfc6d0abead8d9ab341b8

5 years agoNullable: System.Runtime.InteropServices.dll
Stephen Toub [Wed, 17 Apr 2019 21:47:39 +0000 (17:47 -0400)]
Nullable: System.Runtime.InteropServices.dll

Commit migrated from https://github.com/dotnet/corefx/commit/b7617868a15031f2c5f5635864f32f68b3ddfa4b

5 years agoNullable: System.Security.Principal.dll
Stephen Toub [Wed, 17 Apr 2019 21:39:38 +0000 (17:39 -0400)]
Nullable: System.Security.Principal.dll

Commit migrated from https://github.com/dotnet/corefx/commit/71a0946fe6894465684d4710031daeac1620e01c

5 years agoNullable: System.Threading.dll
Stephen Toub [Wed, 17 Apr 2019 21:38:37 +0000 (17:38 -0400)]
Nullable: System.Threading.dll

Commit migrated from https://github.com/dotnet/corefx/commit/3353a2c6020b1ee8f026c08a04325ec3858cfa48

5 years agoNullable: System.Threading.Thread.dll
Stephen Toub [Wed, 17 Apr 2019 21:30:03 +0000 (17:30 -0400)]
Nullable: System.Threading.Thread.dll

Commit migrated from https://github.com/dotnet/corefx/commit/b90aa1fa7648e221fda87ff5f90c5630dabd82da

5 years agoNullable: System.Diagnostics.Tools.dll
Stephen Toub [Wed, 17 Apr 2019 21:27:49 +0000 (17:27 -0400)]
Nullable: System.Diagnostics.Tools.dll

Commit migrated from https://github.com/dotnet/corefx/commit/2f5cbfdbc6349e4df2a1e4f1ff69df3fbfd94c25

5 years agoNullable: System.Memory.dll
Stephen Toub [Wed, 17 Apr 2019 21:25:55 +0000 (17:25 -0400)]
Nullable: System.Memory.dll

Commit migrated from https://github.com/dotnet/corefx/commit/789f770a67472896d69f77b9516dff12f8270eac

5 years agoNullable: System.Runtime.Extensions.dll
Stephen Toub [Wed, 17 Apr 2019 19:21:35 +0000 (15:21 -0400)]
Nullable: System.Runtime.Extensions.dll

Commit migrated from https://github.com/dotnet/corefx/commit/9ed871ca7d963c3a03242c172082ed0099213860

5 years agoNullable: System.Runtime.dll
Stephen Toub [Wed, 17 Apr 2019 15:41:28 +0000 (11:41 -0400)]
Nullable: System.Runtime.dll

Commit migrated from https://github.com/dotnet/corefx/commit/abfc9d4fb689786537edb8660d43205a0f254f64

5 years agoskip all OleDb tests first to unblock other PRs. (dotnet/corefx#37539)
Maryam Ariyan [Thu, 9 May 2019 09:17:53 +0000 (02:17 -0700)]
skip all OleDb tests first to unblock other PRs. (dotnet/corefx#37539)

Commit migrated from https://github.com/dotnet/corefx/commit/f7cd353ab8b08ff45d45985851505e5f8f19f9ac

5 years agoFix dotnet/corefx#37506: System.Text.Json fails to parse enums with negative values...
Paul Buonopane [Thu, 9 May 2019 03:45:57 +0000 (23:45 -0400)]
Fix dotnet/corefx#37506: System.Text.Json fails to parse enums with negative values (dotnet/corefx#37508)

Commit migrated from https://github.com/dotnet/corefx/commit/870cb984d5e3024fcf6ad67ff363ec6be1bff476

5 years agoReenable tests (dotnet/corefx#37521)
Steve MacLean [Thu, 9 May 2019 02:35:40 +0000 (22:35 -0400)]
Reenable tests (dotnet/corefx#37521)

Commit migrated from https://github.com/dotnet/corefx/commit/ca8981317f7e6246efcebc0673f681810d05fbdb

5 years agoFix unnecessary culture-aware comparisons in System.Net (dotnet/corefx#37499)
Stephen Toub [Thu, 9 May 2019 00:24:41 +0000 (20:24 -0400)]
Fix unnecessary culture-aware comparisons in System.Net (dotnet/corefx#37499)

- string.IndexOf(string) and string.IndexOf(string, int) are culture-aware.  For most situations in System.Net, that's undesirable and Ordinal is both more correct and faster.
- string.IndexOf("c", StringComparison.Ordinal) is better off as string.IndexOf('c') for perf and simplicity.
- string.IndexOf('c') >= 0 is better off as string.Contains('c') for perf and simplicity.

Commit migrated from https://github.com/dotnet/corefx/commit/6acc044c36df2138d86620e2c27d3234c4fa0d3d

5 years agoMerge pull request dotnet/corefx#37530 from dotnet/MattGal-patch-1
Matt Galbraith [Thu, 9 May 2019 00:18:05 +0000 (17:18 -0700)]
Merge pull request dotnet/corefx#37530 from dotnet/MattGal-patch-1

Update CI docker images

Commit migrated from https://github.com/dotnet/corefx/commit/ca01d1b54f5593e3f5a184ec1501d563d1653cb0

5 years agoUpdate linux.yml
Matt Galbraith [Wed, 8 May 2019 23:48:50 +0000 (16:48 -0700)]
Update linux.yml

Update to @wfurt 's latest images

Commit migrated from https://github.com/dotnet/corefx/commit/451379d814430af36f67cddd30d112f3fc39d705

5 years agoUpdate CI docker images
Matt Galbraith [Wed, 8 May 2019 22:55:21 +0000 (15:55 -0700)]
Update CI docker images

@wfurt FYI;  we may need to tweak permissions still on these images too.

Commit migrated from https://github.com/dotnet/corefx/commit/24da9d731bb11b90cdd1f95a0b88965339f0271a

5 years agoUpdate issue-guide.md
Maryam Ariyan [Wed, 8 May 2019 22:03:12 +0000 (15:03 -0700)]
Update issue-guide.md

Commit migrated from https://github.com/dotnet/corefx/commit/d6c6eea2cb526224512e9f87a2bc0fbfbd912974

5 years agohandle Http2Stream add/remove better (dotnet/corefx#37505)
Tomas Weinfurt [Wed, 8 May 2019 21:28:13 +0000 (14:28 -0700)]
handle Http2Stream add/remove better  (dotnet/corefx#37505)

* handle sream add/remove better

* abort connection only if it is not already disposed

* feedback from review

Commit migrated from https://github.com/dotnet/corefx/commit/184bbc41f7e51b025e7a3c041895af8d83bc6864

5 years agoUpdate ProjectNTfs, ProjectNTfsTestILC to beta-27708-01, beta-27708-01, respectively...
dotnet-maestro-bot [Wed, 8 May 2019 12:50:27 +0000 (05:50 -0700)]
Update ProjectNTfs, ProjectNTfsTestILC to beta-27708-01, beta-27708-01, respectively (dotnet/corefx#37507)

Commit migrated from https://github.com/dotnet/corefx/commit/92d3f8dd3b3592b2442596ecf200ebd88c7409c3

5 years ago React to APICompat changes enabling reverse APICompat for facades (dotnet/corefx...
Eric StJohn [Wed, 8 May 2019 02:46:58 +0000 (19:46 -0700)]
 React to APICompat changes enabling reverse APICompat for facades (dotnet/corefx#37375)

* React to APICompat changes enabling reverse APICompat for facades

* Fix UAP and NETFX reverse APICompat issues

* Fix reverse APICompat baseline for allconfigurations build

* Manually update to latest APICompat

* Manually update to latest CoreCLR and fix issues

* Baseline System.Threading.Tasks

* Revert "Manually update to latest CoreCLR and fix issues"

This partially reverts commit dotnet/corefx@ee800617b6a52cc66ac3214717f34b8896320ef9.

I'm keeping the baseline changes which will be needed when we get a new update.

* Temporarily baseline DiagnosticCounter API gaps

This can be removed when get a new CoreCLR

That's currently blocked due to regressions in tests.

Commit migrated from https://github.com/dotnet/corefx/commit/035343743c5a7f67be8a2a2f36913a3c43893b76

5 years agoMerge pull request dotnet/corefx#37501 from dotnet/update-helix-sdk
Matt Galbraith [Tue, 7 May 2019 21:25:31 +0000 (14:25 -0700)]
Merge pull request dotnet/corefx#37501 from dotnet/update-helix-sdk

Update Helix SDK version

Commit migrated from https://github.com/dotnet/corefx/commit/206c19ba8c544544a940673e17d94d68d516f66e

5 years agoFixing SystemNative_GetTimestampResolution for CLOCK_MONOTONIC (dotnet/corefx#37494)
Tanner Gooding [Tue, 7 May 2019 20:17:47 +0000 (13:17 -0700)]
Fixing SystemNative_GetTimestampResolution for CLOCK_MONOTONIC (dotnet/corefx#37494)

Commit migrated from https://github.com/dotnet/corefx/commit/7890b88686e8592c19d1d055f229b699276e4f40

5 years agoPropagate System.Runtime.WindowsRuntime package build targets though transitive refer...
Jeremy Koritzinsky [Tue, 7 May 2019 19:38:54 +0000 (12:38 -0700)]
Propagate System.Runtime.WindowsRuntime package build targets though transitive references. (dotnet/corefx#37476)

* Propagate System.Runtime.WindowsRuntime package build targets though transitive references.

* PR Feedback.

Commit migrated from https://github.com/dotnet/corefx/commit/4285e667694634d7c9e17880f911629e9e4b1686

5 years agoFix nullability mismatch on partial declarations
Stephen Toub [Tue, 7 May 2019 16:10:47 +0000 (12:10 -0400)]
Fix nullability mismatch on partial declarations

Commit migrated from https://github.com/dotnet/corefx/commit/d81fc3589a166ab78096dee0a4ddf0cd2fbd17d7

5 years agoMove WithCancellation/ConfigureAwait extension methods (dotnet/corefx#37367)
Stephen Toub [Tue, 7 May 2019 17:19:40 +0000 (13:19 -0400)]
Move WithCancellation/ConfigureAwait extension methods (dotnet/corefx#37367)

Commit migrated from https://github.com/dotnet/corefx/commit/51478cf10e70e5bbb3577618452522d7f7a80e7b

5 years agoRemove suppression for EventRegistrationToken now that it is no longer duplicated...
Eric StJohn [Tue, 7 May 2019 16:59:33 +0000 (09:59 -0700)]
Remove suppression for EventRegistrationToken now that it is no longer duplicated (dotnet/corefx#37481)

Commit migrated from https://github.com/dotnet/corefx/commit/53bf5f419d7b474293e5ec376feed8ef1223d614

5 years agoRefactor null handling and add tests (dotnet/corefx#37300)
Steve Harter [Tue, 7 May 2019 15:53:25 +0000 (08:53 -0700)]
Refactor null handling and add tests (dotnet/corefx#37300)

Commit migrated from https://github.com/dotnet/corefx/commit/f5ed5a82d8ae626bd756c225a25bf432b92ec472

5 years agoUpdate ProjectNTfs, ProjectNTfsTestILC to beta-27707-00, beta-27707-00, respectively...
dotnet-maestro-bot [Tue, 7 May 2019 15:44:38 +0000 (08:44 -0700)]
Update ProjectNTfs, ProjectNTfsTestILC to beta-27707-00, beta-27707-00, respectively (dotnet/corefx#37484)

Commit migrated from https://github.com/dotnet/corefx/commit/48109190e9099d7b3b089db58c1aa90a05ea7701

5 years agoMaking ctors internal for types with internal abstract methods (dotnet/corefx#37479)
Anirudh Agnihotry [Tue, 7 May 2019 04:27:07 +0000 (21:27 -0700)]
Making ctors internal for types with internal abstract methods (dotnet/corefx#37479)

* making ctors internal for types with internal abstract methods

* fixing build error

Commit migrated from https://github.com/dotnet/corefx/commit/28a926b5b38eefb18cd77b4cb0b74fdda99cdb26

5 years agoupdate Area Owners (dotnet/corefx#37475)
Afsaneh Rafighi [Tue, 7 May 2019 02:58:03 +0000 (19:58 -0700)]
update Area Owners (dotnet/corefx#37475)

Commit migrated from https://github.com/dotnet/corefx/commit/556650604e1976e8b02002b22f0bb6aba149cdb3

5 years agoAdd JsonException and make JsonSerializationException derive from JsonException and...
Steve Harter [Tue, 7 May 2019 01:00:49 +0000 (18:00 -0700)]
Add JsonException and make JsonSerializationException derive from JsonException and be internal (dotnet/corefx#37275)

Commit migrated from https://github.com/dotnet/corefx/commit/f6762c0e37641bf31b9957dc51e74089bac5a310

5 years agoRemove runtime.json from Microsoft.NETCore.Targets (dotnet/corefx#37437)
Eric StJohn [Mon, 6 May 2019 22:10:28 +0000 (15:10 -0700)]
Remove runtime.json from Microsoft.NETCore.Targets (dotnet/corefx#37437)

This supports functionality that is not present in MSBuild-based restore,
it was only usable in project.json which we no longer support.

We keep the package around so that it can replace a 1.0 era version
that brings in runtime.* packages, should it be referenced.

Commit migrated from https://github.com/dotnet/corefx/commit/6704007591fa0e81bc81639616cb6aed9b56329d

5 years agoFix VS Configurations for all projects in corefx (dotnet/corefx#37477)
Jose Perez Rodriguez [Mon, 6 May 2019 21:46:10 +0000 (14:46 -0700)]
Fix VS Configurations for all projects in corefx (dotnet/corefx#37477)

Commit migrated from https://github.com/dotnet/corefx/commit/1c48331eb5784c58b81309665257f454abd7d322

5 years agoRegenerating the System.Numerics.Vectors ref assembly to pick up the changes made...
Tanner Gooding [Mon, 6 May 2019 20:56:38 +0000 (13:56 -0700)]
Regenerating the System.Numerics.Vectors ref assembly to pick up the changes made in S.P.Corelib (dotnet/corefx#37473)

* Regenerating the System.Numerics.Vectors ref assembly to pick up the changes made in S.P.Corelib

* Fixing the ApiCompatBaseline for System.Numerics.Vectors

Commit migrated from https://github.com/dotnet/corefx/commit/881021d6799973ae0a32addbc8e84d7b1f99768f

5 years agoUpdate SerializerProgrammingModel.md (dotnet/corefx#37478)
Randolph West [Mon, 6 May 2019 20:54:03 +0000 (14:54 -0600)]
Update SerializerProgrammingModel.md (dotnet/corefx#37478)

"Supprt" typo.

Commit migrated from https://github.com/dotnet/corefx/commit/6a53eef1e3cdacada60ec9a70d6a48a23bd0e062

5 years agoMerge pull request dotnet/corefx#37340 from dotnet/ViktorHofer-sdk-3.0.100-preview6
Viktor Hofer [Mon, 6 May 2019 20:31:23 +0000 (22:31 +0200)]
Merge pull request dotnet/corefx#37340 from dotnet/ViktorHofer-sdk-3.0.100-preview6

Update the dotnet SDK to 3.0.100-preview6-011681 (latest)

Commit migrated from https://github.com/dotnet/corefx/commit/0757f65ea7c796b3dd9195b327e8055c48d8604b

5 years agoDon't include the nupkg/nuspec from the package folder
ericstj [Mon, 6 May 2019 17:48:11 +0000 (10:48 -0700)]
Don't include the nupkg/nuspec from the package folder

Package testing was failing because the SDK probed up the directory
structure for the locally copied CLI and found our package nupkg/nuspec.

Commit migrated from https://github.com/dotnet/corefx/commit/0375997f5bda0aeab769834ae1881c96910273c7

5 years agoMerge pull request dotnet/corefx#37474 from dotnet/Fix-Ubuntu-19.04-usage
Matt Galbraith [Mon, 6 May 2019 18:25:14 +0000 (11:25 -0700)]
Merge pull request dotnet/corefx#37474 from dotnet/Fix-Ubuntu-19.04-usage

Update Ubuntu 19.04 Docker Image

Commit migrated from https://github.com/dotnet/corefx/commit/a16f9cd7a02f7694218444774a9b488404ed0df9

5 years agoUpdate RID graph
Jeremy Barton [Mon, 6 May 2019 18:15:38 +0000 (11:15 -0700)]
Update RID graph

There are some releases that have already happened that we've missed:
* Fedora 30
* Linux Mint 19.1
* SLES 12.4

Others are upcoming / in beta:
* Debian 10 (June)
* Linux Mint 19.2 (announced, no date)
* openSUSE 15.1 (imminent)
* SLES 15.1 (June)
* Fedora 31 (October)
* Ubuntu 19.10 (October)
* Oracle Linux 8(.0) (Beta)

Commit migrated from https://github.com/dotnet/corefx/commit/e486c461f4c2c6609285f94b6948c5e67a9f7bd5

5 years agoFix remaining races in WriteAsync (dotnet/corefx#37414)
David Fowler [Mon, 6 May 2019 18:10:04 +0000 (11:10 -0700)]
Fix remaining races in WriteAsync (dotnet/corefx#37414)

* Fix remaining races in WriteAsync
- Lock everything, this ensures Complete won't interfere with the copying or flushing

* Enable test

Commit migrated from https://github.com/dotnet/corefx/commit/5921c1076078e90c3998f41890dddeeb704b790c

5 years agoUpdate Ubuntu 19.04 Docker Image
Matt Galbraith [Mon, 6 May 2019 17:54:54 +0000 (10:54 -0700)]
Update Ubuntu 19.04 Docker Image

Addresses https://github.com/dotnet/corefx/issues/37321

Commit migrated from https://github.com/dotnet/corefx/commit/852f46def1b9abfebbf6cc58aa39c256a63f520a

5 years agoFix Timezone Test with Morocco on Windows (dotnet/corefx#37419)
Tarek Mahmoud Sayed [Mon, 6 May 2019 17:14:23 +0000 (10:14 -0700)]
Fix Timezone Test with Morocco on Windows (dotnet/corefx#37419)

Commit migrated from https://github.com/dotnet/corefx/commit/5518ab965f32dafebc7be23be295531030fd9677

5 years agoOptimize Enumerable.Range(...).Select(...) (dotnet/corefx#37410)
Stephen Toub [Mon, 6 May 2019 14:14:31 +0000 (10:14 -0400)]
Optimize Enumerable.Range(...).Select(...) (dotnet/corefx#37410)

* Optimize Enumerable.Range(...).Select(...)

Looking at some large code indexes, by far the most common uses of Enumerable.Range are when it's either directly iterated with a foreach, converted to an array with ToArray, or probably the most common, succeeded by Select.  The first two are already decently optimized, with a custom range iterator returned from Enumerable.Range and that iterator already having a ToArray override.  But it's missing the Select case.  This commit adds that, by copying the existing SelectArrayIterator and then just tweaking it to use _start/_end rather than accessing a stored _source array.

* Add more Debug.Asserts

Commit migrated from https://github.com/dotnet/corefx/commit/23f320bcc04c6bdd6ec2338e8b999710e81e5839

5 years agoUpdate ProjectNTfs, ProjectNTfsTestILC to beta-27706-00, beta-27706-00, respectively...
dotnet-maestro-bot [Mon, 6 May 2019 11:06:20 +0000 (04:06 -0700)]
Update ProjectNTfs, ProjectNTfsTestILC to beta-27706-00, beta-27706-00, respectively (dotnet/corefx#37459)

Commit migrated from https://github.com/dotnet/corefx/commit/ea58ec54ccea6ea73cbc920ca9b331b67bcc5703

5 years agoSwitch to newer, explicit atomic API (dotnet/corefx#37456)
Shay Rojansky [Mon, 6 May 2019 07:58:49 +0000 (00:58 -0700)]
Switch to newer, explicit atomic API (dotnet/corefx#37456)

Starting with clang 8, the older __sync atomic functions produce a
warning for implicit strong memory barriers. This switches to the
newer __atomic API where memory ordering is explicitly specified.

Fixes dotnet/corefx#37174

Commit migrated from https://github.com/dotnet/corefx/commit/bd278630dd08914ef521e62658afb69845c5b93a

5 years agoAdd FlushAsync (dotnet/corefx#37458)
Gérald Barré [Mon, 6 May 2019 02:28:17 +0000 (22:28 -0400)]
Add FlushAsync (dotnet/corefx#37458)

Commit migrated from https://github.com/dotnet/corefx/commit/322eeeb25e1b5eae950bb6494383406902def5f9

5 years agoDisable GetSchema test on Win7 (dotnet/corefx#37450)
Viktor Hofer [Mon, 6 May 2019 00:43:14 +0000 (02:43 +0200)]
Disable GetSchema test on Win7 (dotnet/corefx#37450)

Commit migrated from https://github.com/dotnet/corefx/commit/f5c963fabcca42d7f2ad9b3c313d93abe7d3d37a

5 years agoMove System.Text.Encodings.Web inbox (dotnet/corefx#37398)
Levi Broderick [Sun, 5 May 2019 00:02:19 +0000 (17:02 -0700)]
Move System.Text.Encodings.Web inbox (dotnet/corefx#37398)

- netstandard1.0 support is harvested
- internal copies of APIs like memmove are removed in favor of in-box implementations

Commit migrated from https://github.com/dotnet/corefx/commit/464097cfc9c970c7ce31288fbd7e7cd8930364ca

5 years agoDefine X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS on non-portable compat builds
Jeremy Barton [Sat, 4 May 2019 16:39:28 +0000 (09:39 -0700)]
Define X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS on non-portable compat builds

Commit migrated from https://github.com/dotnet/corefx/commit/a0ad6436bdbcee831362268fdba99bcc7badd683

5 years agoAdding Microsoft.Bcl.HashCode package for .NET Standard 2.0 (dotnet/corefx#37273)
Jose Perez Rodriguez [Sat, 4 May 2019 15:00:46 +0000 (08:00 -0700)]
Adding Microsoft.Bcl.HashCode package for .NET Standard 2.0 (dotnet/corefx#37273)

* Adding Microsoft.Compatibility.HashCode package for .NET Standard 2.0

* Fixing package configurations and addressing description comment

* Addressing PR Feedback

* Renaming to Microsoft.Bcl.HashCode

* Addressing more PR feedback

Commit migrated from https://github.com/dotnet/corefx/commit/4dda7cfd17b95ab3da927a853ec468068f18a231

5 years agoSystem.Data.OleDb.Tests.OleDbConnectionTests.GetSchema failed in CI (dotnet/corefx...
Maryam Ariyan [Sat, 4 May 2019 14:33:21 +0000 (07:33 -0700)]
System.Data.OleDb.Tests.OleDbConnectionTests.GetSchema failed in CI (dotnet/corefx#37438)

Fixes dotnet/corefx#37411
- Remove small bit of dead code.
- Add test and cleanup test code
- Fix System.Data.OleDb.Tests.OleDbConnectionTests.GetSchema failure on CI

Commit migrated from https://github.com/dotnet/corefx/commit/742d6367892167256617de5c3c7b9b1eae67bea2

5 years agoPort several Interaction methods (dotnet/corefx#37436)
Charles Stoner [Sat, 4 May 2019 05:53:18 +0000 (22:53 -0700)]
Port several Interaction methods (dotnet/corefx#37436)

Commit migrated from https://github.com/dotnet/corefx/commit/fcaec7c79abef572985d9b7973e4a8c6a6384f41

5 years agoChanged File.Copy to throw if destination is a directory on macOS (dotnet/corefx...
Dávid Kaya [Sat, 4 May 2019 02:50:13 +0000 (04:50 +0200)]
Changed File.Copy to throw if destination is a directory on macOS (dotnet/corefx#36713) (dotnet/corefx#37428)

Commit migrated from https://github.com/dotnet/corefx/commit/e21c2b5af100dc5d70ef1777f5de21d0d5a96210

5 years agoRegenerating the System.Runtime.Intrinsics and System.Numerics.Vectors reference...
Tanner Gooding [Sat, 4 May 2019 02:11:07 +0000 (19:11 -0700)]
Regenerating the System.Runtime.Intrinsics and System.Numerics.Vectors reference assemblies (dotnet/corefx#37424)

* Renaming System.Runtime.Intrinsics.cs to System.Runtime.Intrinsics.Experimental.cs

* Updating GenerateReferenceSource to pass through LangVersion

* Regenerating the System.Numerics.Vectors ref assembly

Commit migrated from https://github.com/dotnet/corefx/commit/23c22eb9c6838e5e4ce24ffbc97085e797942da3

5 years agoCreate Utf8String package install docs (dotnet/corefx#37421)
Levi Broderick [Sat, 4 May 2019 01:27:12 +0000 (18:27 -0700)]
Create Utf8String package install docs (dotnet/corefx#37421)

Commit migrated from https://github.com/dotnet/corefx/commit/7ce249aa13e564968c867bd97c1a589bf4dc34b9

5 years agoFix deadlock in SystemEventsTests.CreateTimerTests (dotnet/corefx#37426)
Stephen Toub [Sat, 4 May 2019 01:01:39 +0000 (21:01 -0400)]
Fix deadlock in SystemEventsTests.CreateTimerTests (dotnet/corefx#37426)

* Fix deadlock in SystemEventsTests.CreateTimerTests

The main thread in the ConcurrentTimers takes a lock on object timersSignaled and then calls CreateTimer while holding the lock.  CreateTimer tries to SendMessageW a message to be processed by the events window, and as a result won’t return until the window has processed the message.  Meanwhile, that window’s WindowThreadProc is handling a timer callback, which in the event handler in ConcurrentTimers tries to take the timersSignaled lock.  That lock is held by the main thread, that’s calling CreateTimer and doing the SendMessageW that will only wake up when this callback completes.  Deadlock.

The fix is to stop locking while performing such work.

* Address PR feedback

Commit migrated from https://github.com/dotnet/corefx/commit/4b4b791e56cfc5e3afc9fc918e51fb9b975ae0ab

5 years agoUse X509_check_host when available instead of a custom implementation.
Jeremy Barton [Fri, 3 May 2019 23:51:42 +0000 (16:51 -0700)]
Use X509_check_host when available instead of a custom implementation.

X509_check_host was added in OpenSSL 1.0.2, but the Debian 8 line is still
on 1.0.1, so keep our version as a fallback.

The local_ implementation was changed to support wildcard CN values in
3+ label names, because OpenSSL X509_check_host does, too.

Commit migrated from https://github.com/dotnet/corefx/commit/af5a54a64406d40e2108dfc521dcea7867342f69

5 years agoUpdate doc for Preview 5 (dotnet/corefx#37433)
Steve Harter [Fri, 3 May 2019 23:03:07 +0000 (16:03 -0700)]
Update doc for Preview 5 (dotnet/corefx#37433)

Commit migrated from https://github.com/dotnet/corefx/commit/214f424c1821c4b8979b37762098defe17ac0db6

5 years agoDisable GetPropertyValues_NotStoredProperty_ValueEqualsNull test (dotnet/corefx#37420)
Stephen Toub [Fri, 3 May 2019 21:34:24 +0000 (17:34 -0400)]
Disable GetPropertyValues_NotStoredProperty_ValueEqualsNull test (dotnet/corefx#37420)

* Disable GetPropertyValues_NotStoredProperty_ValueEqualsNull test

* Disable the other test as well

Commit migrated from https://github.com/dotnet/corefx/commit/3c13f6e53bd57db3a75c8ddbbf2be6b3b6b7c934

5 years agoLog exceptions from asynchronously failing Expect: 100-continue sends (dotnet/corefx...
Stephen Toub [Fri, 3 May 2019 21:33:55 +0000 (17:33 -0400)]
Log exceptions from asynchronously failing Expect: 100-continue sends (dotnet/corefx#37391)

* 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

5 years agoUse RemoveInvoke in several StringTests (dotnet/corefx#37417)
Stephen Toub [Fri, 3 May 2019 20:23:17 +0000 (16:23 -0400)]
Use RemoveInvoke in several StringTests (dotnet/corefx#37417)

Every test that modifies CurrentCulture should be run out-of-process (to avoid one test interfering with another, either due to leaving a thread configured inappropriately or due to platforms where changing culture actually has global impact).  A few snuck in to StringTests that weren't, and we've seen sporadic failures as a result.

Commit migrated from https://github.com/dotnet/corefx/commit/d301a1d1485764e57822c91b9727018c02765cd8

5 years agoPort AssemblyInfo, ConsoleApplicationBase.CommandLineArgs, ComputerInfo.*Memory ...
Charles Stoner [Fri, 3 May 2019 19:41:33 +0000 (12:41 -0700)]
Port AssemblyInfo, ConsoleApplicationBase.CommandLineArgs, ComputerInfo.*Memory (dotnet/corefx#37413)

Commit migrated from https://github.com/dotnet/corefx/commit/421bcd0ca9565ad74ef4259f74424da2229bc9e3

5 years agoBetter support RSAES_OAEP certificates for EnvelopedCms
Kevin Jones [Fri, 3 May 2019 15:05:38 +0000 (11:05 -0400)]
Better support RSAES_OAEP certificates for EnvelopedCms

Improve the .NET Core EnvelopedCms support on Windows for certificates whose public key says the algorithm is RSA-OAEP to restore .NET Framework-equivalent capability.

Linux and macOS cannot reliably represent those certificates as an X509Certificate2, so their support is unchanged at this time.

Commit migrated from https://github.com/dotnet/corefx/commit/c5d6284dec3136ff9e45d02c5d788f29269ae1df

5 years agoFix Macedonian display name in ComponentModel CultureInfo converter (dotnet/corefx...
Tarek Mahmoud Sayed [Fri, 3 May 2019 14:23:42 +0000 (07:23 -0700)]
Fix Macedonian display name in ComponentModel CultureInfo converter (dotnet/corefx#37390)

* Fix Macedonian display name in ComponentModel CultureInfo converter

* Fix the comment

Commit migrated from https://github.com/dotnet/corefx/commit/d86da53b536b5f327aeaa9292469ea1a151af594

5 years agoPort Constants, Globals, DateAndTime (dotnet/corefx#37376)
Charles Stoner [Fri, 3 May 2019 14:21:35 +0000 (07:21 -0700)]
Port Constants, Globals, DateAndTime (dotnet/corefx#37376)

* Port Constants, Globals, DateAndTime

* PR feedback

* Add DateString test

* Remove using

Commit migrated from https://github.com/dotnet/corefx/commit/ecb4d648de5edbfb9f6907cc05c5e98f7005460e

5 years agoUpdate ProjectNTfs, ProjectNTfsTestILC to beta-27703-00, beta-27703-00, respectively...
dotnet-maestro-bot [Fri, 3 May 2019 14:21:01 +0000 (07:21 -0700)]
Update ProjectNTfs, ProjectNTfsTestILC to beta-27703-00, beta-27703-00, respectively (dotnet/corefx#37356)

Commit migrated from https://github.com/dotnet/corefx/commit/354260c3a67c69a1009e4bf8c2cba4f63c5828cd

5 years agoTweak asserts used in GetGCMemoryInfo test to be more informative (dotnet/corefx...
Stephen Toub [Fri, 3 May 2019 14:13:07 +0000 (10:13 -0400)]
Tweak asserts used in GetGCMemoryInfo test to be more informative (dotnet/corefx#37387)

With Assert.True, all we know is whether the test passed or failed.  With Assert.Equal and Assert.InRange, a failure will include information about the input values.

Commit migrated from https://github.com/dotnet/corefx/commit/dab7fd41802389b41f4b22b6e1caac2b8df54d3d

5 years agoFix build break in HttpClientHandlerTest
Viktor Hofer [Fri, 3 May 2019 10:23:37 +0000 (12:23 +0200)]
Fix build break in HttpClientHandlerTest

Caused by https://github.com/dotnet/corefx/commit/dotnet/corefx@c412fa7dc60559dc38050c63b2e34b5156a2499e

Commit migrated from https://github.com/dotnet/corefx/commit/3075793b035cfa51d5b2a8aa0d388ee41faf2bf9

5 years agoimprove error handling on failed Http/2 handshake (dotnet/corefx#37050)
Tomas Weinfurt [Fri, 3 May 2019 06:31:53 +0000 (23:31 -0700)]
improve error handling on failed Http/2 handshake (dotnet/corefx#37050)

* improve error handling on failed Http/2 handshake

* remove extra space

* add test for HTTP2 client talking to HTTP1 server.

* fix broken tests

* improve exception handling

* update exception handling

* ws update

* fix bad merge

* update test and changes from dotnet/corefx#37223

* use _abortException only if the stream is not aborted already

* fix IsAborted check

* updates to syncup with recent changes

Commit migrated from https://github.com/dotnet/corefx/commit/c412fa7dc60559dc38050c63b2e34b5156a2499e

5 years agoreject invalid pseudo-headers (dotnet/corefx#37069)
Tomas Weinfurt [Fri, 3 May 2019 06:23:27 +0000 (23:23 -0700)]
reject invalid pseudo-headers (dotnet/corefx#37069)

* reject invalid pseudo-headers

* feedback from review

* feedback from review

* fix typo in comment

* feedback from review

* syncup with recent changes

Commit migrated from https://github.com/dotnet/corefx/commit/1f159018b21e1f70fa2ade50d5e341f5ce457654

5 years agoimpove error reporting on OSX (dotnet/corefx#37382)
Tomas Weinfurt [Fri, 3 May 2019 04:13:20 +0000 (21:13 -0700)]
impove error reporting on OSX (dotnet/corefx#37382)

Commit migrated from https://github.com/dotnet/corefx/commit/25d7b8b252bbf4d8b7606804db55b96d8d8027f4

5 years agoFix TestPriorityLevelProperty test (dotnet/corefx#37377)
Stephen Toub [Fri, 3 May 2019 00:29:58 +0000 (20:29 -0400)]
Fix TestPriorityLevelProperty test (dotnet/corefx#37377)

* Fix TestPriorityLevelProperty test

If the target thread goes away between the time we grab it and try to manipulate it, the test fails.  Instead, just create a thread in the current process, as we can then target that one directly and ensure it's always in a good state for testing against.

* Address PR feedback

Commit migrated from https://github.com/dotnet/corefx/commit/dd368445da30401b9dd2290a9612fccf617063b9

5 years agoStart on object serialization. (dotnet/corefx#36806)
Jeremy Kuhne [Thu, 2 May 2019 18:58:42 +0000 (11:58 -0700)]
Start on object serialization. (dotnet/corefx#36806)

* Add JsonElement to object support

Object and object[] properties now get JsonElement for their value when deserializing. When serializing out the JsonElements are rehydrated into their original Json.

* Remove the done TODO

* Add JsonElement property tests.

* Initial complex object/JsonElement support. Skipping one test temporarily.

* Add Skip condition and reenable test.

* Address feedback.

* Address more feedback, add more tests.

* Addressing feedback.

Commit migrated from https://github.com/dotnet/corefx/commit/de0effdf96e40747ce18d47d7248cc936d2192a9

5 years agoFix SendAsync_No100ContinueReceived_RequestBodySentEventually test flakiness (dotnet...
Stephen Toub [Thu, 2 May 2019 18:56:19 +0000 (14:56 -0400)]
Fix SendAsync_No100ContinueReceived_RequestBodySentEventually test flakiness (dotnet/corefx#37371)

The server in the test was sending down the entire response and then trying to read the data from the client.  If the client sent its whole payload and read the response before the server go around to doing the read, the client might close the connection, in which case the read might fail.  The fix just changes the server code to only send down the headers, then read the data from the client, and only then finish the response, at which point it's fine if the client closes the connection.

Commit migrated from https://github.com/dotnet/corefx/commit/772aa2d1029caa8be3b360168b63dadd42ae788b

5 years agoFix MultipleCallsToGetSpan test with pinning (dotnet/corefx#37373)
Stephen Toub [Thu, 2 May 2019 18:41:02 +0000 (14:41 -0400)]
Fix MultipleCallsToGetSpan test with pinning (dotnet/corefx#37373)

The test is getting two pointers to an array and validating that they're the same pointer.  But if the array is moved by the GC between the two calls, the test fails.  The fix is to pin the array.

Commit migrated from https://github.com/dotnet/corefx/commit/1a2401cd4c3f56c022173d2ac1e0c34799d387e3

5 years agoPorts System.Data.OleDb (dotnet/corefx#37101)
Maryam Ariyan [Thu, 2 May 2019 17:42:33 +0000 (10:42 -0700)]
Ports System.Data.OleDb (dotnet/corefx#37101)

Commit migrated from https://github.com/dotnet/corefx/commit/5374d01ef2337a85adc13a2b2cf0a354c6199c86

5 years agoTweak preferLocal value in System.Net.Sockets (dotnet/corefx#37369)
Stephen Toub [Thu, 2 May 2019 17:29:40 +0000 (13:29 -0400)]
Tweak preferLocal value in System.Net.Sockets (dotnet/corefx#37369)

These ThreadPool.UnsafeQueueUserWorkItem calls come from a non-thread pool thread, and as such currently the preferLocal argument has no effect and was defaulted to false when this was written.  But logically it makes sense for it to be true, and it could start to have an effect if we make a change to the thread pool that allows threads to share their local queues.

Commit migrated from https://github.com/dotnet/corefx/commit/bf0fb29fb55cf4c3d9063c78e8f72fb9cd4d041b

5 years agoFix test failure in XmlWriterTraceListenerTests.ListenerWithFilter (dotnet/corefx...
Stephen Toub [Thu, 2 May 2019 17:17:54 +0000 (13:17 -0400)]
Fix test failure in XmlWriterTraceListenerTests.ListenerWithFilter (dotnet/corefx#37368)

This test randomly and somewhat amusingly failed in CI.  The test validates that a particular value passed into one of the writer's methods doesn't show up in the output, but the writer also outputs the current process ID, and the process ID happened to match that value.  The fix is to just ensure it doesn't.

Commit migrated from https://github.com/dotnet/corefx/commit/541d941e6e59793cd56708cd81e9fff85ec112f8

5 years agoSurround InvalidLargeEncode outerloop test with try-catch to avoid OOM (dotnet/corefx...
Ahson Khan [Thu, 2 May 2019 17:04:58 +0000 (10:04 -0700)]
Surround InvalidLargeEncode outerloop test with try-catch to avoid OOM (dotnet/corefx#37355)

* Disable InvalidLargeEncode test on x86 to prevent OOM

Commit migrated from https://github.com/dotnet/corefx/commit/359762251831ef498814f6718a54f5b91439d974

5 years agoDisable flaky Dns GetHostName tests on OSX (dotnet/corefx#37363)
Viktor Hofer [Thu, 2 May 2019 14:32:27 +0000 (16:32 +0200)]
Disable flaky Dns GetHostName tests on OSX (dotnet/corefx#37363)

Commit migrated from https://github.com/dotnet/corefx/commit/ef02cf17b5cdb57d5277b158cd3afba047df4d1b

5 years agoNop LongProcessNamesAreSupported test on Alpine (dotnet/corefx#37350)
Santiago Fernandez Madero [Thu, 2 May 2019 06:28:49 +0000 (23:28 -0700)]
Nop LongProcessNamesAreSupported test on Alpine (dotnet/corefx#37350)

Commit migrated from https://github.com/dotnet/corefx/commit/3728c9618debe640c22d7469fe4aa937f4a774b7

5 years agoEnable HTTP/2 in SocketsHttpHandler via HttpRequestMessage.Version (dotnet/corefx...
Stephen Toub [Thu, 2 May 2019 04:15:28 +0000 (00:15 -0400)]
Enable HTTP/2 in SocketsHttpHandler via HttpRequestMessage.Version (dotnet/corefx#37234)

We now respect the version: if it's 1.1, we use 1.1, and if it's 2.0, we try to use HTTP/2.  At the same time, the default for HttpRequestMessage.Version goes back to 1.1, so to use HTTP/2, you opt-in by setting the version explicitly to 2.0.

Commit migrated from https://github.com/dotnet/corefx/commit/d69d441dfb0710c2a34155c7c4745db357b14c96

5 years agoTypos etc (dotnet/corefx#37349)
Dan Moseley [Thu, 2 May 2019 04:14:26 +0000 (21:14 -0700)]
Typos etc (dotnet/corefx#37349)

Commit migrated from https://github.com/dotnet/corefx/commit/b57618e6d1caa03c809e343885f06a5b0791b2c2

5 years agoDisable GetAsync_UnicodeHostName_SuccessStatusCodeInResponse test
Stephen Toub [Thu, 2 May 2019 04:12:02 +0000 (00:12 -0400)]
Disable GetAsync_UnicodeHostName_SuccessStatusCodeInResponse test

Commit migrated from https://github.com/dotnet/corefx/commit/419a1fe5da1698ea3a380166ab70b11ab37dbde0

5 years agoAdded Range Manipulation APIs to Collection<T> and ObservableCollection<T> (dotnet...
Andrew Hoefling [Thu, 2 May 2019 03:57:56 +0000 (23:57 -0400)]
Added Range Manipulation APIs to Collection<T> and ObservableCollection<T> (dotnet/corefx#35772)

* Added Collection<T> AddRange and InsertRange and added new XUnit tests to cover new APIs

Added missing APIs from Collection<T>; Added new unit tests for RemoveRange, ReplaceRange, InsertItemsRange and RemoveItemsRange

Updated AddRange in Collection<T> to add items to the end of the collection

Added CollectionChanged tests for ObservableCollection<T> for InsertRange, AddRange, RemoveRange and ReplaceRange

Removing API changes as these will be mirrored from CoreCLR

Updated array assertions to use Span<T> to simplify logic

Sorted order of new API methods

Simplified CollectionTests Assertion to use Span<T> instead of calling out each item in the array

Added missing API ReplaceItemsRange and updated unit tests for check for overflow errors on RemoveItems

Added overrides for ObservableCollection<T> ItemsRange API to only fire CollectionChanged once per API call. Before this was firing for each item in the collection which is not the desired result. Updated unit tests to verify this logic

Updated RemoveItemsRange to prevent int.MaxValue overflow errors

Added int.MaxValue overflow tests for Collection<T> and ObservableCollection<T> when invoking RemoveItemsRange API

Added additional RemoveRange unit tests to cover when Count is Less than 0 or when Count is 0

Updated RemoveRange overflow tests to check for ArgumentException for new business rules

Updated ObservableCollection overflow test to assert ArgumentException

Added try-finally block to ObservableCollection<T> to certify that _skipCollectionChanged is always set to false after a collection manipulation in case an exception is thrown in a subclass. Added new test class to test the new rules on the example of a NonNullObservableCollection<T>

CollectionChanged events do not fire on RemoveRange if the count == 0

Updated ObservableCollection<T> to only throw the 3 required events when ReplaceItemsRange is invoked. Updated OnChangedEvent methods to check for IList and cast as necessary. Added additional exception handling to reset _skipRaisingEvents bool. Added unit tests to verify event and event parameters are being passed correctly.

Added Collection<T> AddRange and InsertRange and added new XUnit tests to cover new APIs

Simplified CollectionTests Assertion to use Span<T> instead of calling out each item in the array

Added additional RemoveRange unit tests to cover when Count is Less than 0 or when Count is 0

Updated ObservableCollection<T> to only throw the 3 required events when ReplaceItemsRange is invoked. Updated OnChangedEvent methods to check for IList and cast as necessary. Added additional exception handling to reset _skipRaisingEvents bool. Added unit tests to verify event and event parameters are being passed correctly.

Updated ReplaceRange event to pass in the OldItems and NewItems to match the event docs

Simplified CollectionChanged 'NewItems for InsertItemsRange

Updated removedItems to use an array instead of a List<T>

Added new OnCollectionChanged overloads to reduce need for additional if checks.

Removed stale code

Optimized ReplaceItemsRange by simplifying the itemsToReplace which is no an array instead of a List<T>

Removed (IList) cast in ReplaceItemsRange when raising CollectionChanged

Removed temp array in RemoveRange which decreases memory allocation needed

* Removed redudent AsSpan parameter in test code

* Removed stale code in test code

* Removed redundent Assert.NotNull calls in several tests

* Added additional check in InsertRange to verify the input collection.Count is greater than 0 before raising the events

* Removed stale code from the `NonNullObservableCollection<T>` test harness

* Removed unnecessary whitespace

* Renamed new API tests to include the .netcoreapp extension; Updated .Tests.csproj file to only run them when the project is built under .NET core as net standard is the default

* Renamed CollectionTests -> CollectionTests.netcoreapp.cs and only run the test if it is a netcoreapp as the new APIs aren't in netstandard yet

* Added UAP and UAPAOT build configurations for System.ObjectModel tests

* Updated ObservableCollection/Collection tests that use new APIs to be in a partial class with the .netcoreapp.cs extension and existings tests to be in the .cs file.

* Added CollectionTestBase as parent class for CollectionTests for the use case where the other tests are ignored in netstandard builds

* Adding using statements back in which were failing the build

* Moving private classes from the netcoreapp tests to the regular CollectionTests as they were not available in the netstandard CI test run

* Added missing using statement for colleciton tests

* Added if-block that certifies we have replaced items before raising the Replace Event on ReplaceItemsRange

* Removed whitespace in System.Runtime.Tests.csproj

* Added negative test case for ReplaceRange when no items are replaced

* Fixed issue with failing test

Commit migrated from https://github.com/dotnet/corefx/commit/b705522753f09d501762cca6c45d6bd031c112d7

5 years agoMake ProcessTests.HandleCountChanges more reliable (dotnet/corefx#37330)
Stephen Toub [Thu, 2 May 2019 01:49:37 +0000 (21:49 -0400)]
Make ProcessTests.HandleCountChanges more reliable (dotnet/corefx#37330)

* Make ProcessTests.HandleCountChanges more reliable

* Address PR feedback

* Update CoreFx.Private.TestUtilities.csproj

Commit migrated from https://github.com/dotnet/corefx/commit/d398edffd620fd3e4136963faedfea3a9a8e66b0