Skip to content

Running benchmarks hangs at "// Validating benchmarks:" when you have many, many SDKs installed #2873

@thatnerdyguy

Description

@thatnerdyguy

If you have many, many SDKs installed (in our case 89 ... this is from a localized dotnet install via the UseDotNet task in devops pipelines), and then attempt to run benchmarks, you get stuck at the

// Validating benchmarks:

Bringing up ProcessMonitor, we could see the host benchmark executable was waiting on

dotnet --list-sdks

to finish. We assume from DotNetSdkValidator.GetInstalledDotNetSdks(). That function does:

process.WaitForExit();
// stuff
var output = process.StandardOutput.ReadToEnd();

However, per the docs (https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.processstartinfo.redirectstandardoutput?view=net-9.0#remarks) that approach will deadlock when the stdout buffer gets full. Instead you want to:

var output = process.StandardOutput.ReadToEnd();
process.WaitForExit();

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions