]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Try fix random shuttle test failures (#27186)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Sat, 20 Apr 2024 22:03:55 +0000 (10:03 +1200)
committerGitHub <noreply@github.com>
Sat, 20 Apr 2024 22:03:55 +0000 (08:03 +1000)
Content.IntegrationTests/Pair/TestPair.Recycle.cs
Content.IntegrationTests/Tests/PostMapInitTest.cs
Content.IntegrationTests/Tests/Station/EvacShuttleTest.cs

index 52fdf600bb46e94713a5940d16b26dee0d43ca31..c0f4b3b745f50bffbf0f8669909ffb96082b57f0 100644 (file)
@@ -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);
 
index 060ef4ef297110b3040352c64074c54c79a462ca..522f5e377a6665e2318ded383053bb76c8ddd033 100644 (file)
@@ -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<IMapManager>();
index a01aac3099bd7fd68074754029238d0a330e0fa6..5750be09c241b9f5219a178cb21ad126864e651f 100644 (file)
@@ -25,6 +25,9 @@ public sealed class EvacShuttleTest
         var entMan = server.EntMan;
         var ticker = server.System<GameTicker>();
 
+        // Dummy ticker tests should not have centcomm
+        Assert.That(entMan.Count<StationCentcommComponent>(), Is.Zero);
+
         var shuttleEnabled = pair.Server.CfgMan.GetCVar(CCVars.EmergencyShuttleEnabled);
         pair.Server.CfgMan.SetCVar(CCVars.GameMap, "Saltern");
         pair.Server.CfgMan.SetCVar(CCVars.GameDummyTicker, false);