From 489105c4c092dba90aa378d9a032423177728102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20N=C3=A4geli?= Date: Thu, 7 Nov 2024 18:40:51 +0100 Subject: [PATCH] Add timeout --- Engine/Kestrel/Hosting/KestrelServer.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Engine/Kestrel/Hosting/KestrelServer.cs b/Engine/Kestrel/Hosting/KestrelServer.cs index 8acb8e28..13275fb4 100644 --- a/Engine/Kestrel/Hosting/KestrelServer.cs +++ b/Engine/Kestrel/Hosting/KestrelServer.cs @@ -62,7 +62,9 @@ internal KestrelServer(IServerCompanion? companion, ServerConfiguration configur startEvent.Set(); }); - startEvent.Wait(); + var started = startEvent.Wait(5000); + + if (!started) throw new InvalidOperationException("Server did not start within 5 seconds"); } #endregion