Skip to content

Commit

Permalink
Revert WaitForProcess in UI Tests (#3189)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmprieur authored Jan 9, 2025
1 parent cc6f871 commit 230e1d5
Show file tree
Hide file tree
Showing 2 changed files with 5 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); }
await UiTestHelpers.KillProcessTreesAsync(processes);
UiTestHelpers.KillProcessTrees(processes);

// Stop tracing and export it into a zip archive.
string path = UiTestHelpers.GetTracePath(_testAssemblyPath, TraceFileName);
Expand Down
6 changes: 4 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 async Task KillProcessTreesAsync(Queue<Process> processQueue)
public static void KillProcessTrees(Queue<Process> processQueue)
{
Process currentProcess;
while (processQueue.Count > 0)
Expand All @@ -258,7 +258,9 @@ public static async Task KillProcessTreesAsync(Queue<Process> processQueue)
{
processQueue.Enqueue(child);
}
await currentProcess.WaitForExitAsync();
// Do not call "await currentProcess.WaitForExitAsync();"
// as the web APIs never terminate by themselves (they are a loop
// that serves requests until the process is killed).
currentProcess.StandardOutput.Close();
currentProcess.StandardError.Close();

Expand Down

0 comments on commit 230e1d5

Please sign in to comment.