From 679bc7d0cbbc2fea26ec82df4ea2e84f17c71c92 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Wed, 20 Dec 2023 22:27:07 -0500 Subject: [PATCH] Switch back to dynamic live tests port allocation --- tests/Tgstation.Server.Tests/Live/TestLiveServer.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/Tgstation.Server.Tests/Live/TestLiveServer.cs b/tests/Tgstation.Server.Tests/Live/TestLiveServer.cs index 6edee102ea..60781753a2 100644 --- a/tests/Tgstation.Server.Tests/Live/TestLiveServer.cs +++ b/tests/Tgstation.Server.Tests/Live/TestLiveServer.cs @@ -147,9 +147,6 @@ namespace Tgstation.Server.Tests.Live static ushort FreeTcpPort(params ushort[] usedPorts) { - var portList = new ushort[] { 42069, 42070, 42071, 42072, 42073, 42074 }; - return portList.First(x => !usedPorts.Contains(x)); - /* ushort result; var listeners = new List(); @@ -171,7 +168,7 @@ namespace Tgstation.Server.Tests.Live result = (ushort)((IPEndPoint)l.LocalEndpoint).Port; } - while (usedPorts.Contains(result) || result < 10000); + while (usedPorts.Contains(result) || result < 20000); } finally { @@ -180,8 +177,9 @@ namespace Tgstation.Server.Tests.Live l.Stop(); } } + + Console.WriteLine($"Allocated port: {result}"); return result; - */ } [ClassInitialize]