Merge branch 'master' into dev

This commit is contained in:
tgstation-server
2023-06-20 02:39:48 +00:00
2 changed files with 24 additions and 1 deletions
@@ -96,6 +96,9 @@ namespace Tgstation.Server.Tests.Live.Instance
await InteropTestsForLongRunningDme(cancellationToken);
// for the restart staging tests
await DeployTestDme("LongRunning/long_running_test", DreamDaemonSecurity.Trusted, true, cancellationToken);
System.Console.WriteLine("TEST: END WATCHDOG TESTS");
}
@@ -1030,7 +1033,8 @@ namespace Tgstation.Server.Tests.Live.Instance
DisconnectTimeout = TimeSpan.FromSeconds(30)
}, loggerFactory.CreateLogger("WatchdogTest.TopicClient"));
public async Task<DreamDaemonResponse> TellWorldToReboot(CancellationToken cancellationToken)
public Task<DreamDaemonResponse> TellWorldToReboot(CancellationToken cancellationToken) => TellWorldToReboot2(instanceClient, cancellationToken);
public static async Task<DreamDaemonResponse> TellWorldToReboot2(IInstanceClient instanceClient, CancellationToken cancellationToken)
{
var daemonStatus = await instanceClient.DreamDaemon.Read(cancellationToken);
Assert.IsNotNull(daemonStatus.StagedCompileJob);
@@ -1000,6 +1000,7 @@ namespace Tgstation.Server.Tests.Live
try
{
Api.Models.Instance instance;
long initialStaged, initialActive;
using (var adminClient = await CreateAdminClient(server.Url, cancellationToken))
{
if (server.DumpOpenApiSpecpath)
@@ -1058,6 +1059,13 @@ namespace Tgstation.Server.Tests.Live
await Task.WhenAll(rootTest, adminTest, instancesTest, instanceTests, usersTest);
var dd = await instanceClient.DreamDaemon.Read(cancellationToken);
Assert.AreEqual(WatchdogStatus.Online, dd.Status.Value);
Assert.IsNotNull(dd.StagedCompileJob);
Assert.AreNotEqual(dd.StagedCompileJob.Id, dd.ActiveCompileJob.Id);
initialActive = dd.ActiveCompileJob.Id.Value;
initialStaged = dd.StagedCompileJob.Id.Value;
await adminClient.Administration.Restart(cancellationToken);
}
@@ -1134,6 +1142,10 @@ namespace Tgstation.Server.Tests.Live
var dd = await instanceClient.DreamDaemon.Read(cancellationToken);
Assert.AreEqual(WatchdogStatus.Online, dd.Status.Value);
Assert.IsNotNull(dd.StagedCompileJob);
Assert.AreNotEqual(dd.StagedCompileJob.Id, dd.ActiveCompileJob.Id);
Assert.AreEqual(initialStaged, dd.StagedCompileJob.Id);
Assert.AreEqual(initialActive, dd.ActiveCompileJob.Id);
var chatReadTask = instanceClient.ChatBots.List(null, cancellationToken);
@@ -1155,6 +1167,13 @@ namespace Tgstation.Server.Tests.Live
Assert.AreEqual(connectedChannelCount, channelsPresent);
await WatchdogTest.TellWorldToReboot2(instanceClient, cancellationToken);
dd = await instanceClient.DreamDaemon.Read(cancellationToken);
Assert.AreEqual(WatchdogStatus.Online, dd.Status.Value);
Assert.IsNull(dd.StagedCompileJob);
Assert.AreEqual(initialStaged, dd.ActiveCompileJob.Id);
await instanceClient.DreamDaemon.Shutdown(cancellationToken);
dd = await instanceClient.DreamDaemon.Update(new DreamDaemonRequest
{