From 9c388e4700e9d47cfdca15c827c62868277c166f Mon Sep 17 00:00:00 2001 From: Dominion Date: Mon, 3 Apr 2023 00:02:30 -0400 Subject: [PATCH] Finally got the error detection for this test working --- .../Tgstation.Server.Tests/IntegrationTest.cs | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/tests/Tgstation.Server.Tests/IntegrationTest.cs b/tests/Tgstation.Server.Tests/IntegrationTest.cs index 4ff01cd9e8..123b786ff3 100644 --- a/tests/Tgstation.Server.Tests/IntegrationTest.cs +++ b/tests/Tgstation.Server.Tests/IntegrationTest.cs @@ -1003,12 +1003,28 @@ namespace Tgstation.Server.Tests await wdt.TellWorldToReboot(cancellationToken); expectedCompileJobId = compileJob.Id.Value; - dd = await instanceClient.DreamDaemon.Read(cancellationToken); - Assert.AreEqual(WatchdogStatus.Online, dd.Status.Value); + bool first = true; + do + { + if (first) + first = false; + else + await Task.Delay(TimeSpan.FromSeconds(1)); + + dd = await instanceClient.DreamDaemon.Read(cancellationToken); + } + while (dd.Status.Value == WatchdogStatus.Restoring); + Assert.AreEqual(dd.ActiveCompileJob.Job.Id, expectedCompileJobId); + Assert.AreEqual(WatchdogStatus.Online, dd.Status.Value); expectedCompileJobId = dd.ActiveCompileJob.Id.Value; + await instanceClient.DreamDaemon.Update(new DreamDaemonRequest + { + AutoStart = false, + }, cancellationToken); + await adminClient.Administration.Restart(cancellationToken); }