* 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]>
* Revert dotnet/corefx#40415's changes to PLINQ tests
They broke outerloop significantly.
* Fix MemberData(BinaryOperations) usage in PLINQ
Lots of outerloop tests are failing because xunit is preferring the wrong overload of the BinaryOperations method via reflection. This just renames some of the methods to avoid the overloads.
Commit migrated from https://github.com/dotnet/corefx/commit/8429c2a5cc01ac07122f4439f360f8ab2ca4ae86
* Re-enable xunit warning 1026 (unused theory arguments)
Some of these were addressed by explicitly discarding theory arguments, generally in cases where either a) the argument was being used as a description to aid in debugging failures, or b) the argument was part of a member data that was used by some theories and not by others all sharing the same member data.
However, there are quite a few legitimate bugs being fixed here, enough that highlights it's worthwhile to have the rule enabled. Some are cases where the argument was supposed to be used but wasn't. Some are cases where the argument isn't used at all, and in many cases where we end up running the same test over and over and wasting cycles. Some are cases where we're unnecessarily including irrelevant inputs to the tests and making the input data more complicated than it needs to be. Etc.
(Along the way, I also fixed some cases where VS was warning about lambdas being used instead of local functions, and in cases where I agreed I fixed them, via auto-fixers.)
* Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/daf93ee0e5e5233141eb762c64b6049cfd7d123e
* added project for performance tests
* added performance tests for GroupJoin and Join creation and enumeration
* cleaned up Join/GroupJoin perf tests
* added GroupBy perf tests for comparison purposes
* added perf test for Join when left source is OrdinalIndexState.Shuffled
* modified Join/GroupJoin/GroupBy perf tests to get a better profile for different left/right/group sizes
* added GroupBy EnumerateGroup perf tests
* added Join perf test for Shuffled left and unordered right
* added larger right element list sizes to perf tests to GroupJoin with ordered right and Join with ordered left and ordered right
* wrapping right stream of joins to enable preserving order (needed to fix issue dotnet/corefx#1155)
* Factored out building rightHashLookup to eventually move to a separate class to allow for ordering of elements
* refactored out the list of right values for hash joins
* added comments and changed type param names on HashLookupValueList
* Added HashLookupBuilder
* added comments and changed type param names on HashLookupBuilder
* factoring out HashLookupBuilder as an abstract base class and an implementation for use with Join operations
* modifying JoinQueryOperator to use the HashJoinQueryOperatorEnumerator constructor taking a HashLookupBuilder
* added HashJoinHashLookup to wrap calls to TryGetValue of HashLookup in HashJoinQueryOperatorEnumerator
* added a Head accessor to HashLookupValueList to allow for adding to the GroupJoin result list
* moved JoinHashLookup inside JoinHashLookupBuilder as it should only be used there
* added GroupJoinHashLookupBuilder for unordered group join
* refactored common HashLookup building code to base class
* removed old HashJoinQueryOperatorEnumerator constructor and unnecessary handling of multiple types of resultSelectors
* handling GroupJoin with an ordered right (inner) ParallelQuery
* Revert "added a Head accessor to HashLookupValueList to allow for adding to the GroupJoin result list"
ended up not using the Head accessor
This reverts commit dotnet/corefx@26eb5014fb.
* preparing to allow for a combined key when both left and right sources are ordered
* added handling for a right key on GroupJoins when both the left and right sources are ordered
* added PairOutputKeyBuilder for when both left and right sources of a Join/GroupJoin are ordered
* handling GroupJoins when both left and right sources ordered
* added tests that include collisions in the left ordering to make sure the right key ordering is affecting the output ordering
* handling parallel Join with an ordered right source
* reverting some of the original probe phase of HashJoinQueryOperatorEnumerator.MoveNext source to have a closer memory use/copy profile especially in unordered cases
* moved HashJoin helper classes to the files where they are used
* added SkipOnTargetFramework netfx to tests that assume right ordering is preserved
* added information to SkipOnTargetFramework as per review
* fix for Join so that ambiguous ordering of left elements does not result in mixed output (see https://github.com/dotnet/corefx/pull/27930#issuecomment-372007875 and following for examples)
* refactored common code of left ordering collision tests
* moved left collision test helper class
* add Join tests with non-uniquely ordered lefts and unordered rights (to illustrate behavior change described in https://github.com/dotnet/corefx/pull/27930#issuecomment-372084741)
* changed OrdinalIndexState.Increasing comment to remove ambiguity (it does not allow equal indices). This is an important distinction for Join, SelectMany, Skip/Take, etc.
* changed OrderedGroupByGrouping.DoneAdding to use Array.Sort to improve performance
* removed unnecessary member/comparer from OrderedGroupByGrouping
* changed OrderedGroupByGrouping to use ListChunk for accumulating data
* added the Service to System.Linq.Parallel.Tests.csproj that visual studio so desperately wants
Commit migrated from https://github.com/dotnet/corefx/commit/28121c077ec06124c2cec82e10704c9f2a05977c
- Avoid using Enumerable.Append, which isn't available in desktop
- Suppress tests on desktop where the test is verifying a bug fix in core
- Allow some variance to account for different floating point support in desktop vs core
Commit migrated from https://github.com/dotnet/corefx/commit/ed3ec8b0681211e82036a294c7857d77a4edabf2
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
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
* 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
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