Skip to content

Commit 1710b64

Browse files
authored
Add null handling for process output/error data in UiTestHelpers (#3184)
* null handling for process output/error data * apply suggestions!
1 parent d83d251 commit 1710b64

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/E2E Tests/WebAppUiTests/UiTestHelpers.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,17 @@ public static Process StartProcessLocally(
182182
else
183183
{
184184
// Log the output and error streams
185-
process.OutputDataReceived += (sender, e) => output.WriteLine(e.Data);
186-
process.ErrorDataReceived += (sender, e) => output.WriteLine(e.Data);
185+
process.OutputDataReceived += (sender, e) =>
186+
{
187+
output.WriteLine($"{process.Id} ");
188+
output.WriteLine(e?.Data ?? "null output data received.");
189+
};
190+
191+
process.ErrorDataReceived += (sender, e) =>
192+
{
193+
output.WriteLine($"{process.Id} ");
194+
output.WriteLine(e?.Data ?? "null error data received.");
195+
};
187196

188197
process.BeginOutputReadLine();
189198
process.BeginErrorReadLine();

0 commit comments

Comments
 (0)