Fix threading issue in source build smoke tests (#15009)
This commit is contained in:
parent
03c15d0900
commit
b504dab642
1 changed files with 20 additions and 6 deletions
|
@ -75,16 +75,30 @@ internal static class ExecuteHelper
|
|||
process.WaitForExit();
|
||||
}
|
||||
|
||||
string output = stdOutput.ToString().Trim();
|
||||
if (logOutput && !string.IsNullOrWhiteSpace(output))
|
||||
string output;
|
||||
string error;
|
||||
|
||||
lock (stdOutput)
|
||||
{
|
||||
outputHelper.WriteLine(output);
|
||||
output = stdOutput.ToString().Trim();
|
||||
}
|
||||
|
||||
string error = stdError.ToString().Trim();
|
||||
if (logOutput && !string.IsNullOrWhiteSpace(error))
|
||||
lock (stdError)
|
||||
{
|
||||
outputHelper.WriteLine(error);
|
||||
error = stdError.ToString().Trim();
|
||||
}
|
||||
|
||||
if (logOutput)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(output))
|
||||
{
|
||||
outputHelper.WriteLine(output);
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(error))
|
||||
{
|
||||
outputHelper.WriteLine(error);
|
||||
}
|
||||
}
|
||||
|
||||
return (process, output, error);
|
||||
|
|
Loading…
Reference in a new issue