* 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
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
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