From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Sat, 20 Apr 2024 22:03:55 +0000 (+1200) Subject: Try fix random shuttle test failures (#27186) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=c4f050259d7dc6da5c81187d4a575413685b1f6b;p=space-station-14.git Try fix random shuttle test failures (#27186) --- diff --git a/Content.IntegrationTests/Pair/TestPair.Recycle.cs b/Content.IntegrationTests/Pair/TestPair.Recycle.cs index 52fdf600bb..c0f4b3b745 100644 --- a/Content.IntegrationTests/Pair/TestPair.Recycle.cs +++ b/Content.IntegrationTests/Pair/TestPair.Recycle.cs @@ -131,7 +131,7 @@ public sealed partial class TestPair : IAsyncDisposable // Move to pre-round lobby. Required to toggle dummy ticker on and off if (gameTicker.RunLevel != GameRunLevel.PreRoundLobby) { - await testOut.WriteLineAsync($"Recycling: {Watch.Elapsed.TotalMilliseconds} ms: Restarting server."); + await testOut.WriteLineAsync($"Recycling: {Watch.Elapsed.TotalMilliseconds} ms: Restarting round."); Assert.That(gameTicker.DummyTicker, Is.False); Server.CfgMan.SetCVar(CCVars.GameLobbyEnabled, true); await Server.WaitPost(() => gameTicker.RestartRound()); @@ -146,6 +146,7 @@ public sealed partial class TestPair : IAsyncDisposable // Restart server. await testOut.WriteLineAsync($"Recycling: {Watch.Elapsed.TotalMilliseconds} ms: Restarting server again"); + await Server.WaitPost(() => Server.EntMan.FlushEntities()); await Server.WaitPost(() => gameTicker.RestartRound()); await RunTicksSync(1); diff --git a/Content.IntegrationTests/Tests/PostMapInitTest.cs b/Content.IntegrationTests/Tests/PostMapInitTest.cs index 060ef4ef29..522f5e377a 100644 --- a/Content.IntegrationTests/Tests/PostMapInitTest.cs +++ b/Content.IntegrationTests/Tests/PostMapInitTest.cs @@ -155,7 +155,10 @@ namespace Content.IntegrationTests.Tests [Test, TestCaseSource(nameof(GameMaps))] public async Task GameMapsLoadableTest(string mapProto) { - await using var pair = await PoolManager.GetServerClient(); + await using var pair = await PoolManager.GetServerClient(new PoolSettings + { + Dirty = true // Stations spawn a bunch of nullspace entities and maps like centcomm. + }); var server = pair.Server; var mapManager = server.ResolveDependency(); diff --git a/Content.IntegrationTests/Tests/Station/EvacShuttleTest.cs b/Content.IntegrationTests/Tests/Station/EvacShuttleTest.cs index a01aac3099..5750be09c2 100644 --- a/Content.IntegrationTests/Tests/Station/EvacShuttleTest.cs +++ b/Content.IntegrationTests/Tests/Station/EvacShuttleTest.cs @@ -25,6 +25,9 @@ public sealed class EvacShuttleTest var entMan = server.EntMan; var ticker = server.System(); + // Dummy ticker tests should not have centcomm + Assert.That(entMan.Count(), Is.Zero); + var shuttleEnabled = pair.Server.CfgMan.GetCVar(CCVars.EmergencyShuttleEnabled); pair.Server.CfgMan.SetCVar(CCVars.GameMap, "Saltern"); pair.Server.CfgMan.SetCVar(CCVars.GameDummyTicker, false);