From 13749149db6cb74d6c8bf6aed1bd5fb32f9e53db Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Sat, 18 Nov 2023 23:45:45 -0500 Subject: [PATCH] This seems to be a fairly reproducible topic hang, which is nice to have --- .../Live/TestLiveServer.cs | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/tests/Tgstation.Server.Tests/Live/TestLiveServer.cs b/tests/Tgstation.Server.Tests/Live/TestLiveServer.cs index 1afece3b7a..cef619e679 100644 --- a/tests/Tgstation.Server.Tests/Live/TestLiveServer.cs +++ b/tests/Tgstation.Server.Tests/Live/TestLiveServer.cs @@ -1475,11 +1475,24 @@ namespace Tgstation.Server.Tests.Live var chatReadTask = instanceClient.ChatBots.List(null, cancellationToken); // Check the DMAPI got the channels again https://github.com/tgstation/tgstation-server/issues/1490 - topicRequestResult = await WatchdogTest.StaticTopicClient.SendTopic( - IPAddress.Loopback, - $"tgs_integration_test_tactics7=1", - mainDDPort, - cancellationToken); + var tries = 3; + while (true) + try + { + // HEY I THINK I FOUND A WAY TO RELIABLY REPRODUCE THE TOPIC HANG + // JUST SET A BREAKPOINT IN THE CATCH + // Maybe, with enough investigation, either I can figure out the cause or get Lummox to tell me + topicRequestResult = await WatchdogTest.StaticTopicClient.SendTopic( + IPAddress.Loopback, + $"tgs_integration_test_tactics7=1", + mainDDPort, + cancellationToken); + break; + } + catch (OperationCanceledException) when (--tries > 0) + { + await Task.Delay(TimeSpan.FromSeconds(5), cancellationToken); + } Assert.IsNotNull(topicRequestResult); if(!Int32.TryParse(topicRequestResult.StringData, out var channelsPresent))