From ffd2786fc9908bda38a84fefd5b4770a76145330 Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 16 Jun 2023 04:36:52 -0400 Subject: [PATCH] Only test topic limits + 1 in tests Fixes #1540 --- .../Tgstation.Server.Tests/Live/Instance/WatchdogTest.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/Tgstation.Server.Tests/Live/Instance/WatchdogTest.cs b/tests/Tgstation.Server.Tests/Live/Instance/WatchdogTest.cs index d560bcc9bf..b9278aec6d 100644 --- a/tests/Tgstation.Server.Tests/Live/Instance/WatchdogTest.cs +++ b/tests/Tgstation.Server.Tests/Live/Instance/WatchdogTest.cs @@ -530,10 +530,11 @@ namespace Tgstation.Server.Tests.Live.Instance }; var json = JsonConvert.SerializeObject(baseTopic, DMApiConstants.SerializerSettings); - var topicString = $"tgs_integration_test_tactics3={TopicClient.SanitizeString(json)}"; - var baseSize = topicString.Length; - var wrappingSize = baseSize; + var baseSize = (int)(DMApiConstants.MaximumTopicRequestLength - 1); + + var topicString = $"tgs_integration_test_tactics3={TopicClient.SanitizeString(json)}"; + var wrappingSize = topicString.Length; while (!cancellationToken.IsCancellationRequested) { @@ -584,7 +585,7 @@ namespace Tgstation.Server.Tests.Live.Instance System.Console.WriteLine("TEST: Receiving Topic tests topics..."); // Receive - baseSize = 1; + baseSize = (int)(DMApiConstants.MaximumTopicResponseLength - 1); nextPow = 0; lastSize = 0; while (!cancellationToken.IsCancellationRequested)