Commit Graph
28 Commits
Author SHA1 Message Date
Stephen Toub 3db33c3869 Reduce PLINQ tests outerloop from ~250s to ~85s
The tests have been overhauled and are in fairly decent shape, so there wasn't as much low-hanging fruit as in some of the other test libraries, but there are still a few notable places we can make improvements and others we can cut back without losing quality of coverage.

Changes:
- Even though some care had been taken to avoid it, at least one DegreeOfParallelismTests was taking an extra ~25s on my machine waiting for the thread pool to ramp up.  Fixed via the same helper used in other test libs.
- Removed ReadOnlyCollection as a source.  There are special PLINQ code paths for arrays, lists, ParallelEnumerable.Range, and custom partitioners, but not for other collection types, so I've commented out that source until such time as we do have such special cases.  This removes ~1/6th of the test cases and an equivalent amount of execution time.
- Improved throughput of the IntegerRangeSet helper, which is used in lots of tests and was a source of significant contention due to a lock used in the main Add method.  Replacing it with a SpinLock reduced execution time by ~10%.
- Removed ParallelEnumerable.Range as an "expander" in the SelectSelectManyTests.  The delegate is returning an IEnumerable, so subsequent operations performed on the expander aren't continuing the PLINQ execution and are instead starting a new one, making this essentially equivalent to (but more expensive than and duplicative of) the Enumerable.Range expander that already exists.
- Lowered outerloop default iteration count from 64K*ProcCount to 16K*ProcCount
- Lowered OrderByThenByTest outerloop iteration count from 32K to 16K, and removed the additional 1K iteration count being performed.


Commit migrated from https://github.com/dotnet/corefx/commit/2a75aefbe2cd8c951ac3cfb8ab2ea324847ae90c
2016-06-17 12:34:40 -04:00
Stephen Toub 7b96d293ad PLINQ - Fewer/Faster tests (dotnet/corefx#8451)
Peome earlier discussion, I've cut down on the number and running time of the PLINQ tests.

The majority of the cases are still/should be covered, the reductions have generally been in sizes and source types for unordered tests.  Overall, OuterLoop tests on my machine are running about 40% faster. The number of tests is down, but the combinatorial tests still represent the majority of the count.

There are also some minor fixes here and there - dealing with an instance of integer overflow in a helper method, for example.  some earlier discussion, I've cut down on the number and running time of the PLINQ tests.

The majority of the cases are still/should be covered, the reductions have generally been in sizes and source types for unordered tests.  Overall, OuterLoop tests on my machine are running about 40% faster. The number of tests is down, but the combinatorial tests still represent the majority of the count.  There are also some minor fixes here and there - dealing with an instance of integer overflow in a helper method, for example.

Commit migrated from https://github.com/dotnet/corefx/commit/bfabc65b3123dee76406dfce6a0ce16a3b89b0c8
2016-05-11 12:35:17 -04:00
Stephen A. Imhoff 21cba5dacf More PLINQ tests (dotnet/corefx#5117)
* Add Concat combinatorial tests (ordered assumes sequential output).
* Add GroupJoin combinatorial tests.
* Add Join combinatorial tests.
* Add reverse-ordering combinatorial tests.

Commit migrated from https://github.com/dotnet/corefx/commit/67d719a6580ff810b9cd937671c2f0de57d829a4
2016-04-22 07:15:07 -04:00
stephentoub 7a71f6e5e7 Delete faulty PLINQ test
I'd added this test as part of porting ToF tests to match code coverage, but the test is actually faulty: Dispose'ing of the enumerator concurrently with calling MoveNext on the enumerator is not safe or allowed.


Commit migrated from https://github.com/dotnet/corefx/commit/93c3adc9356597e755de9648c4d4b2b39c516b7c
2016-04-12 10:57:29 -04:00
stephentoub e2c0b719f9 Add PLINQ tests to fill ToF gaps
Commit migrated from https://github.com/dotnet/corefx/commit/876f47cdc2ce4407b1e42c5e031b6cca49689745
2016-04-01 16:08:09 -04:00
Stephen A. Imhoff 588094af39 Clean up and expand PLINQ cancellation tests
* Add missing pre-cancelled combinatorial tests (output options only).

* Change Pre-cancelled tests to get token from Functions.AssertAlreadyCanceled.

* Add missing `Any` existence check pre-cancellation test.

* Wrap usual query cancellation to hide complexity.

* Add base helpers and sources for in-flight cancellation.

* Add Aggregate in-flight cancellation tests.

* Add All in-flight cancellation tests.

* Add Any in-flight cancellation tests.

* Add Average in-flight cancellation tests.

* Add Contains in-flight cancellation tests.

* Add Count/LongCount in-flight cancellation tests.

* Add ElementAt/ElementAtOrDefault in-flight cancellation tests.

* Add First/FirstOrDefault in-flight cancellation tests.

* Add ForAll in-flight cancellation tests.

* Add Last/LastOrDefault in-flight cancellation tests.

* Add Max in-flight cancellation tests.

* Add Min in-flight cancellation tests.

* Add SequenceEqual in-flight cancellation tests.

* Add Single/SingleOrDefault in-flight cancellation tests.

* Add Sum in-flight cancellation tests.

* Add ToArray in-flight cancellation tests.

* Add ToDictionary in-flight cancellation tests.

* Add ToList in-flight cancellation tests.

* Add ToLookup in-flight cancellation tests.

* Add foreach in-flight cancellation tests.

* Add cancellation for inner query of binaries.

* Remove basic pre-canceled token tests from `WithCancellationTests` (handled in combinatorial testing).

* Remove in-flight cancellation tests (handled in combinatorial and elsewhere)

* Move enumerator dispose test to GetEnumeratorTests

* Add/correct multiple WithCancellation test (original called WithDegreesOfParallelism)

* Add tests with not cancelable and pre canceled cancellation tokens.

* Remove SelectMany regression test (covered by existing SelectMany tests).

* Add tests for alternate (canceled) cancellation source throwing wrapped OCE.

* Add non-canceled thrown OCE test.

* Condense dealing with disposing the enumerator.
Original tests were liable to cause deadlock due to calling Dispose in a child thread (using an ordered source in an attempt to expand the tests made it a certainty).

* Update and expand ephemeral ODE test (potentially covered in combinatorial?).

* Update test for canceled-then-disposed enumerator.

* Re-use throws wrapped.

* Tweak comment, correct element counts.

* Replace regression test comment in SelectMany tests, tweak PE.Range expander

This comment was originally for a test in WithCancellationTests, but
that test didn't call WithCancellation at all.  Given the nature of the
original test, it was felt that _all_ SelectMany tests would check for
the failure; the original test was thus removed.

* Correct operation.

* Comparers sealed/readonly

* Add missing min/max func cancel combinations.

* Knock down delay time.

* Move (implicit in foreach) MoveNext cancellation test.

* Reduce counts for WithCancellation ProducerBlocked tests.

* Create new AssertThrows helper.
 - Cancellation-related throws provide default source
Switch to new cancellation throws.
 - GetEnumerator switched to internal methods to explicitly run over all sources.

* Split Single/SingleDefault cancellation tests.


Commit migrated from https://github.com/dotnet/corefx/commit/2d1d84d28e45d1d08179dc5ff7bbe4cacb1d5e64
2016-04-01 14:37:49 -04:00
Stephen A. Imhoff 1da9d6101e Remove casts for test source data
Commit migrated from https://github.com/dotnet/corefx/commit/7dbe409ee23ada5bfa8fcfb202067fbd20d9e6ac
2016-02-27 11:41:18 +09:00
Stephen A. Imhoff 9f8d436ebd Correct nameof to refer to correct source class.
Commit migrated from https://github.com/dotnet/corefx/commit/68b6c8a7f2e3d701405703afb37e70116377917f
2016-02-27 11:41:15 +09:00
dotnet-bot b32ddb5d98 Deploy nameof throughout corefx in MemberData
Commit migrated from https://github.com/dotnet/corefx/commit/9c3156b9ada06b8e58ac53d48fc303500bf3e476
2016-02-18 23:58:15 -05:00
dotnet-bot 39d1eab950 Update licensing headers
Commit migrated from https://github.com/dotnet/corefx/commit/7cad8486cbabbce0236bdf530e30db7036335524
2016-01-27 08:02:28 -08:00
stephentoub b1ced5215f Fix System.Linq.Parallel test after ToArray changes
This wasn't caught previously because System.Linq.Parallel.Tests is depending on the System.Linq.dll NuGet package, not the live bits.  Two tests were explicitly verifying object equality.  This isn't necessary; I've simply deleted the offending checks.


Commit migrated from https://github.com/dotnet/corefx/commit/a7d743c973b2eea287c5c6dcde807fe640ed491a
2016-01-23 11:36:31 -05:00
Stephen A. Imhoff 0ace697d7c Expand GetEnumerator Tests.
Commit migrated from https://github.com/dotnet/corefx/commit/37fe1aa4acafa7e11d951a0dd694ac9b3c983db2
2015-09-17 16:54:16 +09:00
Clockwork-Muse 168ab05c98 Add checks for duplicate settings.
Commit migrated from https://github.com/dotnet/corefx/commit/ca3c94dc781c92ae738cd86f0435ac729844e919
2015-09-17 16:54:13 +09:00
Clockwork-Muse f73712cb22 Fix some longrunning tests to point at the correct short ones.
Commit migrated from https://github.com/dotnet/corefx/commit/822501805ab70163b6da1d12cc58dae581a78da9
2015-09-17 16:54:12 +09:00
Clockwork-Muse b3766126c9 Add tests dealing with floating point infinity, NaN (and null).
Commit migrated from https://github.com/dotnet/corefx/commit/9e9d3a24b65426e938cef7851e989018bee0a100
2015-09-17 16:54:11 +09:00
Clockwork-Muse bac3728ec5 Improve Sum floating point overflow tests, add NaN tests.
Commit migrated from https://github.com/dotnet/corefx/commit/348bd1a2e7d0e41e03509ae408b60014d8c11470
2015-09-17 16:54:10 +09:00
Clockwork-Muse a15331e8eb Improve OrderBy/ThenBy tests.
Use explicit ranges instead of boolean check, restrict bounds.
Verify count of items ordered.
Add tests with non-comparable items.


Commit migrated from https://github.com/dotnet/corefx/commit/d5ec9d25dc831ab48bc7eb3cadf5d375e6857257
2015-09-17 16:54:09 +09:00
Clockwork-Muse ac5ac4c87e Clarify "Stable Sort" tests.
Commit migrated from https://github.com/dotnet/corefx/commit/958e9122df2408f93b3dd7e42777a333e89c48e2
2015-09-17 16:54:08 +09:00
Stephen A. Imhoff bf547ac81f Correct Test namespace.
Commit migrated from https://github.com/dotnet/corefx/commit/c9e780fd0d5f8868ba9975616ca895a6a17db79d
2015-09-17 16:54:05 +09:00
Eric Mellino 45d579252b Update Linq.Parallel tests for latest xUnit.
The latest xunit requires that MemberData attributes and their methods
have the same exact signature. I've changed some object[] parameters to
their exact int[] type to account for this behavior change.


Commit migrated from https://github.com/dotnet/corefx/commit/4f5db270924929d9b51a5426db6218d91f454fc0
2015-08-03 12:10:27 -07:00
Stephen Toub 8176e9c803 Merge pull request dotnet/corefx#2305 from Clockwork-Muse/PLINQ_2239
PLINQ - Minor fixes 

Commit migrated from https://github.com/dotnet/corefx/commit/d9ad8dc965d5c1b57eb0942b164953fddaf021a9
2015-07-20 15:17:36 -04:00
Clockwork-Muse c4b82a6b53 Add overflow checking to Average nullable internal aggregation.
Commit migrated from https://github.com/dotnet/corefx/commit/4b55804cdc89e482bd8680fbe04141c9870c9184
2015-07-20 12:05:13 +09:00
Clockwork-Muse 1053bdb68f Remove unused cancelled token check, fix PLINQ version of dotnet/corefx#2239
Commit migrated from https://github.com/dotnet/corefx/commit/0034eef34ce1437b17e3c463cee0a0a34352f615
2015-07-20 12:05:12 +09:00
Clockwork-Muse c3b1d08706 Add preemptive cancellation check for ToArray.
Commit migrated from https://github.com/dotnet/corefx/commit/4dd373d04d60b40f647cd79515f2360244c5df39
2015-07-12 19:03:04 +09:00
Clockwork-Muse e6de1ce75b Parcel out PlinqDelegateExceptions.cs contents, remove.
Update ExchangeTests

Update PlinqModesTests.

Remove file (contents covered more thoroughly by other tests).

Change Union tests to use custom Comparator similar to other set operations.

Add List to sources used for OuterLoop

Change how empty tests are handled.

Add tests for non-comparable types.

Add tests checking for duplicate compared items.

Describe behavior of common range sources

Describe Zip member data functions.

Describe Union member data functions.

Describe OrderBy member data functions

Describe Max/Min member data functions.


Commit migrated from https://github.com/dotnet/corefx/commit/1c3ecb33008d93d47b2e9a42480ebac50821b617
2015-07-11 09:26:58 +09:00
Stephen A. Imhoff f571218e4d Delete ExceptConcatReverseTests.cs
Remove no-longer-needed file (not sure how this escaped)

Commit migrated from https://github.com/dotnet/corefx/commit/94dc2352c7ef69d72e0946ef5a69fbfdb2169019
2015-06-15 21:56:32 +09:00
Clockwork-Muse fdafa7aeb3 Add missing null-argument check to System.Linq.Parallel.Cast().
Add missing null-argument check.
Update tests as necessary.
This makes Cast act the same as the other extension methods, and follow its documented behavior.


Commit migrated from https://github.com/dotnet/corefx/commit/63c1862601662fffd9c601be275e239c612454bb
2015-06-09 19:56:44 +09:00
Clockwork-Muse 6952087b0e Initial cleanup of System.Linq.Parallel test.
Reorganize folders and files.
Update tests to use Theory and MemberData attributes.
Greatly expand source types used.
Add tests against pre-cancelled tokens and exceptions thrown
against output methods.


Commit migrated from https://github.com/dotnet/corefx/commit/6204cf2c3444f5c6aa42b08baaaca5c350dd4317
2015-06-08 07:06:07 +09:00