Commit Graph
13 Commits
Author SHA1 Message Date
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
dotnet-bot 39d1eab950 Update licensing headers
Commit migrated from https://github.com/dotnet/corefx/commit/7cad8486cbabbce0236bdf530e30db7036335524
2016-01-27 08:02:28 -08: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
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
stephentoub a49c54e90b Fix PLINQ modes tests to not timeout or deadlock
The tests for PLINQ's WithExecutionMode were employing a technique to try to verify that multiple workers were indeed participating in the query: the processing of one element would block until another element was processed.  This technique was then applied to queries expected to employ parallelism in their processing.  However, even readily parallelizable queries may in some circumstances end up being processed sequentially.

This fix changes the parallel verification to instead simply track the IDs of tasks involved in the processing.  With PLINQ's current implementation, there will be one task spun up to process each partition, and so counting the number of unique task IDs involved yields the number of tasks that actually did processing; by removing the blocking, we also remove the need for this to be outer loop.  This in and of itself is insufficient, though, as depending on the data source, all of the data could still end up in a single partition; to fix that, the test is changed to only operate over data sources that do fixed partitioning, namely those involving non-load balanced ranges.  With these changes, we can then significantly reduce the number of elements involved in the tests, as they become entirely deterministic with regards to what data is in which partition.  And we can easily add a test that was previously missing: verifying that certain queries are not parallelized and end up running sequentially.


Commit migrated from https://github.com/dotnet/corefx/commit/40779a51f39e07392813cd0dbd72c285e47c0429
2015-08-07 17:16:37 -04: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
stephentoub b931aee629 Add missing license headers to .cs files
There are 77 .cs files in the repo lacking the standard license header we have on the other ~5400 .cs files.  This commit adds the missing ones.


Commit migrated from https://github.com/dotnet/corefx/commit/98157438d8790337f14341528f20d2f788a3279d
2015-07-21 18:52:55 -04: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 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
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