Skip to content

Commit

Permalink
Test assertion and logging to try and narrow down the cause of the Li…
Browse files Browse the repository at this point in the history
…nux advanced watchdog failures
  • Loading branch information
Cyberboss committed Sep 8, 2024
1 parent 4570a20 commit 5696aa5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tests/DMAPI/BasicOperation/Test.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
var/ibf = message == "Failed initial bridge request!"
if(ibf || message == "Failed bridge request, bad json: null" || findtext(message, "byond_world_export: Failed request: ") || message == "Failed to activate API!")
if(ibf)
text2file("yes", "initial_bridge_failed.txt")
world.log << "Writing test fail file..."
text2file("BRIDGE FAILED", "initial_bridge_failed.txt")
world.log << "File exists: [fexists("initial_bridge_failed.txt")]"
del(world)
sleep(1)

Expand Down
6 changes: 5 additions & 1 deletion tests/Tgstation.Server.Tests/Live/Instance/WatchdogTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ async Task RunBasicTest(bool skipApiValidation, CancellationToken cancellationTo
Assert.IsFalse(daemonStatus.SessionId.HasValue);
Assert.IsFalse(daemonStatus.LaunchTime.HasValue);
Assert.IsNull(daemonStatus.StagedCompileJob);
Assert.AreNotEqual(DreamDaemonSecurity.Ultrasafe, daemonStatus.SecurityLevel);

await ExpectGameDirectoryCount(1, cancellationToken);

Expand Down Expand Up @@ -1606,7 +1607,10 @@ async Task CheckDMApiFail(CompileJobResponse compileJob, CancellationToken cance
{
var bridgeFailFile = Path.Combine(gameDir, "initial_bridge_failed.txt");
var initialBridgeFailed = File.Exists(bridgeFailFile);
Assert.AreEqual(expectInitialBridgeFailure, initialBridgeFailed, "Initial bridge failure expectancy not met");

System.Console.WriteLine($"Files in game dir:{Environment.NewLine}{String.Join(Environment.NewLine, Directory.GetFiles(gameDir))}");

Assert.AreEqual(expectInitialBridgeFailure, initialBridgeFailed, $"Initial bridge failure expectancy not met in {gameDir}");

var successFile = Path.Combine(gameDir, "test_success.txt");
Assert.IsTrue(File.Exists(successFile));
Expand Down

0 comments on commit 5696aa5

Please sign in to comment.