Restore trimming test projects serially#65668
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a conditional restore retry in linker trimming tests to work around intermittent NuGet restore races (notably on Windows) when multiple trimming test projects restore shared TestConsoleApps concurrently.
Changes:
- Allows the initial
RestoreMSBuild invocation to continue after failure. - Adds a second
Restoreinvocation that runs only if the first restore failed. - Documents the rationale and links the tracked issue.
|
/backport to release/10.0 |
|
Started backporting to |
|
That clearly didn't work. Trying something else |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/backport to release/10.0 |
|
Started backporting to |
|
/backport to release/10.0 |
|
Started backporting to |
|
@wtgodbe I received a reported pipeline failure with highly parallelized MSBuild that looks similar to what this PR is trying to fix. From my understanding, parallel Build phases each trigger a fallback Restore that recursively In the binlog I did not see the property SkipTrimmingProjectsRestore being set at all. It looks like the Should SkipTrimmingProjectsRestore=true also be passed in the Build call to complete this fix? |
|
@OvesN ah, yes, nice catch! Do you want to submit a PR for that? |
|
@wtgodbe Do you want me to submit an issue? |

Should fix the last flavor of #61178. Trimming tests are built by
BuildAfterTargetingPack.csproj, which first callsRestoreserially, then callsTestin parallel. But the trimming test projects were overwritingRestorewith a no-op target, so the actual restoring was happening in parallel, inPublishTrimmedProjects, which gets called in the target chain forTest. If we haveRestoreactually restore, it'll happen serially like we want.