diff --git a/tests/E2E Tests/WebAppUiTests/B2CWebAppCallsWebApiLocally.cs b/tests/E2E Tests/WebAppUiTests/B2CWebAppCallsWebApiLocally.cs index 066d082cb..c5449e88a 100644 --- a/tests/E2E Tests/WebAppUiTests/B2CWebAppCallsWebApiLocally.cs +++ b/tests/E2E Tests/WebAppUiTests/B2CWebAppCallsWebApiLocally.cs @@ -167,7 +167,7 @@ public async Task Susi_B2C_LocalAccount_TodoAppFunctionsCorrectlyAsync() Queue processes = new Queue(); 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); diff --git a/tests/E2E Tests/WebAppUiTests/UiTestHelpers.cs b/tests/E2E Tests/WebAppUiTests/UiTestHelpers.cs index 6b99eb886..83fa322d4 100644 --- a/tests/E2E Tests/WebAppUiTests/UiTestHelpers.cs +++ b/tests/E2E Tests/WebAppUiTests/UiTestHelpers.cs @@ -245,7 +245,7 @@ public static string GetTracePath(string testAssemblyLocation, string traceName) /// /// queue of parent processes [SupportedOSPlatform("windows")] - public static async Task KillProcessTreesAsync(Queue processQueue) + public static void KillProcessTrees(Queue processQueue) { Process currentProcess; while (processQueue.Count > 0) @@ -258,7 +258,9 @@ public static async Task KillProcessTreesAsync(Queue 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();