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;