Skip to content

Commit 230e1d5

Browse files
authored
Revert WaitForProcess in UI Tests (#3189)
1 parent cc6f871 commit 230e1d5

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

tests/E2E Tests/WebAppUiTests/B2CWebAppCallsWebApiLocally.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public async Task Susi_B2C_LocalAccount_TodoAppFunctionsCorrectlyAsync()
167167
Queue<Process> processes = new Queue<Process>();
168168
if (serviceProcess != null) { processes.Enqueue(serviceProcess); }
169169
if (clientProcess != null) { processes.Enqueue(clientProcess); }
170-
await UiTestHelpers.KillProcessTreesAsync(processes);
170+
UiTestHelpers.KillProcessTrees(processes);
171171

172172
// Stop tracing and export it into a zip archive.
173173
string path = UiTestHelpers.GetTracePath(_testAssemblyPath, TraceFileName);

tests/E2E Tests/WebAppUiTests/UiTestHelpers.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ public static string GetTracePath(string testAssemblyLocation, string traceName)
245245
/// </summary>
246246
/// <param name="processQueue">queue of parent processes</param>
247247
[SupportedOSPlatform("windows")]
248-
public static async Task KillProcessTreesAsync(Queue<Process> processQueue)
248+
public static void KillProcessTrees(Queue<Process> processQueue)
249249
{
250250
Process currentProcess;
251251
while (processQueue.Count > 0)
@@ -258,7 +258,9 @@ public static async Task KillProcessTreesAsync(Queue<Process> processQueue)
258258
{
259259
processQueue.Enqueue(child);
260260
}
261-
await currentProcess.WaitForExitAsync();
261+
// Do not call "await currentProcess.WaitForExitAsync();"
262+
// as the web APIs never terminate by themselves (they are a loop
263+
// that serves requests until the process is killed).
262264
currentProcess.StandardOutput.Close();
263265
currentProcess.StandardError.Close();
264266

0 commit comments

Comments
 (0)