Skip to content

Commit

Permalink
Add null handling for process output/error data in UiTestHelpers (#3184)
Browse files Browse the repository at this point in the history
* null handling for process output/error data

* apply suggestions!
  • Loading branch information
kllysng authored Jan 7, 2025
1 parent d83d251 commit 1710b64
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/E2E Tests/WebAppUiTests/UiTestHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,17 @@ public static Process StartProcessLocally(
else
{
// Log the output and error streams
process.OutputDataReceived += (sender, e) => output.WriteLine(e.Data);
process.ErrorDataReceived += (sender, e) => output.WriteLine(e.Data);
process.OutputDataReceived += (sender, e) =>
{
output.WriteLine($"{process.Id} ");
output.WriteLine(e?.Data ?? "null output data received.");
};

process.ErrorDataReceived += (sender, e) =>
{
output.WriteLine($"{process.Id} ");
output.WriteLine(e?.Data ?? "null error data received.");
};

process.BeginOutputReadLine();
process.BeginErrorReadLine();
Expand Down

0 comments on commit 1710b64

Please sign in to comment.