Skip to content

Commit

Permalink
await the process.WaitForExitAsync call
Browse files Browse the repository at this point in the history
  • Loading branch information
kllysng committed Jan 9, 2025
1 parent 9d7dc47 commit a776bd9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public async Task Susi_B2C_LocalAccount_TodoAppFunctionsCorrectlyAsync()
Queue<Process> processes = new Queue<Process>();
if (serviceProcess != null) { processes.Enqueue(serviceProcess); }
if (clientProcess != null) { processes.Enqueue(clientProcess); }
UiTestHelpers.KillProcessTrees(processes);
await UiTestHelpers.KillProcessTreesAsync(processes);

// Stop tracing and export it into a zip archive.
string path = UiTestHelpers.GetTracePath(_testAssemblyPath, TraceFileName);
Expand Down
4 changes: 2 additions & 2 deletions tests/E2E Tests/WebAppUiTests/UiTestHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public static string GetTracePath(string testAssemblyLocation, string traceName)
/// </summary>
/// <param name="processQueue">queue of parent processes</param>
[SupportedOSPlatform("windows")]
public static void KillProcessTrees(Queue<Process> processQueue)
public static async Task KillProcessTreesAsync(Queue<Process> processQueue)
{
Process currentProcess;
while (processQueue.Count > 0)
Expand All @@ -258,7 +258,7 @@ public static void KillProcessTrees(Queue<Process> processQueue)
{
processQueue.Enqueue(child);
}
_ = currentProcess.WaitForExitAsync();
await currentProcess.WaitForExitAsync();
currentProcess.StandardOutput.Close();
currentProcess.StandardError.Close();

Expand Down

0 comments on commit a776bd9

Please sign in to comment.