-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run template tests run in parallel to save 15min of run time #17672
Conversation
156560f
to
419a2af
Compare
@@ -1,16 +1,19 @@ | |||
using Microsoft.Maui.IntegrationTests.Apple; | |||
|
|||
[assembly: LevelOfParallelism(2)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the key part of the change. Can adjust in the future higher/lower.
var projectName = DotnetInternal.GetProjectName(projectDir); | ||
var projectFile = Path.Combine(projectDir, $"{projectName}.csproj"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change and other projectName
stuff is repeated for nearly every test: it's what ensures that the lengthy project names used throughout the tests are not too long for WinUI AppX (see PR description for more info).
@ruiminhu / @PureWeen / @mattleibow - any thoughts on getting this in? I see this as potentially improving our engineering lives by not only getting test results quite a bit faster, but potentially shorter queue times as well. |
It looks like maybe yes! I set a max of 2 threads parallel because that seems to get significant gains (15min faster!) and so far seems reliable.
Here are examples of build times from a few random builds without the change and the last one is with the change in this PR:
Attempt 1 from this PR - about 15min faster!!!
Attempt 2 from this PR - about 15min faster!!!
And more historical data available in build analytics (go to https://dev.azure.com/xamarin/public/_pipeline/analytics/duration?definitionId=57&contextType=build, filter Stages by

Test Templates
):And the times range from 51min-59min over the last two weeks.
I propose that we take this change to significantly improve build times. We can later consider cranking up the parallelization level and see if it remains reliable. Or, if it seems to make things flaky, it's easy to set it to 1 thread.
This PR includes a few related changes:
Buildmauilibnet60DebugTrue\id01039Buildmauilibnet60DebugTrue.csproj
). In this change the project names are shortened if necessary to prevent issues. As part of (2) to make super-unique names, I caused names to just barely exceed the max length, so (3) became necessary.