From 83c33eaa99da14140531cdc6ab669990e7b6e7e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Fri, 8 Mar 2024 11:56:52 +0100 Subject: [PATCH] Extend delay when waiting for URLs --- src/mono/wasm/Wasm.Build.Tests/BrowserRunner.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/mono/wasm/Wasm.Build.Tests/BrowserRunner.cs b/src/mono/wasm/Wasm.Build.Tests/BrowserRunner.cs index 997e2dc96b518..291c2d472ea06 100644 --- a/src/mono/wasm/Wasm.Build.Tests/BrowserRunner.cs +++ b/src/mono/wasm/Wasm.Build.Tests/BrowserRunner.cs @@ -75,7 +75,17 @@ public async Task StartServerAndGetUrlAsync( cmd.WithErrorDataReceived(outputHandler).WithOutputDataReceived(outputHandler); var runTask = cmd.ExecuteAsync(args); - await Task.WhenAny(runTask, urlAvailable.Task, Task.Delay(TimeSpan.FromSeconds(30))); + var delayTask = Task.Delay(TimeSpan.FromSeconds(30)); + + await Task.WhenAny(runTask, urlAvailable.Task, delayTask); + if (delayTask.IsCompleted) + { + _testOutput.WriteLine("First 30s delay reached, scheduling next one"); + + delayTask = Task.Delay(TimeSpan.FromSeconds(30)); + await Task.WhenAny(runTask, urlAvailable.Task, delayTask); + } + if (runTask.IsCompleted) { var res = await runTask;