-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Milestone
Description
When running benchmark with multiple Jobs that use WithCustomBuildConfiguration
.
Parallel build is failed. and switching to sequential build.
BenchmarkDotNet/src/BenchmarkDotNet/Running/BenchmarkRunnerClean.cs
Lines 365 to 393 in f4bfcd6
logger.WriteLineHeader($"// ***** Building {buildPartitions.Length} exe(s) in Parallel: Start *****"); | |
var buildLogger = buildPartitions.Length == 1 ? logger : NullLogger.Instance; // when we have just one partition we can print to std out | |
var beforeParallelBuild = globalChronometer.GetElapsed(); | |
var buildResults = buildPartitions | |
.AsParallel() | |
.Select(buildPartition => (Partition: buildPartition, Result: Build(buildPartition, rootArtifactsFolderPath, buildLogger))) | |
.AsSequential() // Ensure that build completion events are processed sequentially | |
.Select(build => | |
{ | |
// If the generation was successful, but the build was not, we will try building sequentially | |
// so don't send the OnBuildComplete event yet. | |
if (buildPartitions.Length <= 1 || !build.Result.IsGenerateSuccess || build.Result.IsBuildSuccess) | |
eventProcessor.OnBuildComplete(build.Partition, build.Result); | |
return build; | |
}) | |
.ToDictionary(build => build.Partition, build => build.Result); | |
var afterParallelBuild = globalChronometer.GetElapsed(); | |
logger.WriteLineHeader($"// ***** Done, took {GetFormattedDifference(beforeParallelBuild, afterParallelBuild)} *****"); | |
if (buildPartitions.Length <= 1 || !buildResults.Values.Any(result => result.IsGenerateSuccess && !result.IsBuildSuccess)) | |
return buildResults; | |
logger.WriteLineHeader("// ***** Failed to build in Parallel, switching to sequential build *****"); |
I though parallel build failure is caused because obj\project.assets.json
is shared between build configurations.
And wrong dependencies are used for parallel build.
Is is able to add options to disable parallel build?
And If it can disable parallel build. It will be a workaround for #2425 also.