Intermittent error "Could not find build environment"
This is the same issue as #125 , except now the problem is dotnet --info sometimes does not make it in 4 seconds (I am running a lot of concurrent analyzers). See hardcoded timeout in https://github.com/daveaglick/Buildalyzer/blob/da88770a2952f7894c05cd0866ef9d766f78aaea/src/Buildalyzer/Environment/DotnetPathResolver.cs#L63
I have 3 options for solving/improving it:
- Don't impose a timeout at all in that particular method.
- Pass around
CancellationTokenand let the caller handle timeout conditions. - (incomplete solution) Increase timeout interval or make it configurable.
- (incomplete solution) In that particular method, use
WaitForExitwith timeout in a loop. Continue looping if during the last 4 secondsdotnet --infoadded some output.
Additionally, it is not clear to me right now why the output of dotnet --info can not be cached after the first run (per dotnet path). Environment variables for that call are hardcoded, and the only thing that's changing is the current directory, which can only affect result in a narrow case: running on Windows (or on *nix with PATH env var containing .), and there's a dotnet.exe next to the project file.