Parallelize AspNetCore 3.x E2E tests to cut CI runtime from ~3.4h to ~12min - #2906
Open
WanjohiSammy wants to merge 1 commit into
Open
Parallelize AspNetCore 3.x E2E tests to cut CI runtime from ~3.4h to ~12min#2906WanjohiSammy wants to merge 1 commit into
WanjohiSammy wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issues
The Core E2E 3x Tests pipeline step (
Microsoft.Test.E2E.AspNetCore3x.OData.csproj) runs the ~4900-test suite serially for ~3.4 hours on the Microsoft-hosted agent.Description
Enable xUnit parallelism for the AspNetCore 3.x E2E project only and harden test isolation so the suite is stable under concurrency. Test-only change - no product code is modified.
Root cause of the 3.4h:
WebHostTestFixtureapplied[assembly: CollectionBehavior(CollectionPerAssembly, MaxParallelThreads = 1)], forcing fully serial execution. Naive parallelism deadlocks instead, because many EF test classes concurrentlyDROP/CREATEthe single shared(LocalDb)\MSSQLLocalDBinstance.Changes:
#if NETCORE && !NETCORE2x) with a moderate cap:[assembly: CollectionBehavior(MaxParallelThreads = 4)]. Classic (.NET Framework) and AspNetCore 2.x keep the original serial behavior.[Collection("Database")](24 classes) so they never run concurrently: all EF/LocalDB-backed classes, plus the formerAggregation(shared static state) andTimeZoneTests(process-globalTimeZoneInfo) collections - folded together becauseDateAndTimeOfDayTestis both EF- and TimeZone-sensitive. In-memory classes stay parallel;Singleton/Batch/JsonLightMetadatacollections unchanged.ModelBoundQuerySettingsCombinedTest modelMaxTop(process-global default could leak across concurrent servers); raisePortArrangerreserve-retry budget (10 → 200); accept a connection reset in the oversized-header DoS test.Checklist (Uncheck if it is not completed)
Additional work necessary
If documentation update is needed, please add "Docs Needed" label to the issue and provide details about the required document change in the issue.