Skip to content

Commit

Permalink
Hopefully fixes the test errors with the linux advanced watchdog
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyberboss committed Sep 8, 2024
1 parent 5696aa5 commit 74f680e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/Tgstation.Server.Tests/Live/Instance/WatchdogTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,19 @@ async Task RunBasicTest(bool skipApiValidation, CancellationToken cancellationTo
Assert.AreEqual("test=bababooey", daemonStatus.AdditionalParameters);
daemonStatus = await DeployTestDme($"BasicOperation/basic operation_test{(skipApiValidation ? "_nov3" : String.Empty)}", DreamDaemonSecurity.Trusted, skipApiValidation ? DMApiValidationMode.Skipped : DMApiValidationMode.Required, cancellationToken);

// hardlinks and DMAPI checks don't play well together
bool linuxAdvancedWatchdogWeirdness = skipApiValidation
&& testVersion.Engine.Value == EngineType.Byond
&& !new PlatformIdentifier().IsWindows
&& !watchdogRestartsProcess;

var oldSecLevel = daemonStatus.SecurityLevel.Value;
if (linuxAdvancedWatchdogWeirdness)
await instanceClient.DreamDaemon.Update(new DreamDaemonRequest
{
SecurityLevel = DreamDaemonSecurity.Trusted,
}, cancellationToken);

Assert.AreEqual(WatchdogStatus.Offline, daemonStatus.Status.Value);
Assert.IsNotNull(daemonStatus.ActiveCompileJob);

Expand Down Expand Up @@ -756,6 +769,7 @@ async Task RunBasicTest(bool skipApiValidation, CancellationToken cancellationTo
{
AdditionalParameters = string.Empty,
LogOutput = true,
SecurityLevel = linuxAdvancedWatchdogWeirdness ? oldSecLevel : null,
}, cancellationToken);
Assert.AreEqual(string.Empty, daemonStatus.AdditionalParameters);
Assert.IsFalse(daemonStatus.SessionId.HasValue);
Expand Down

0 comments on commit 74f680e

Please sign in to comment.