]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix SpawnAndDeleteEntityCountTest heisentest (#21975)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Thu, 30 Nov 2023 11:08:08 +0000 (22:08 +1100)
committerGitHub <noreply@github.com>
Thu, 30 Nov 2023 11:08:08 +0000 (22:08 +1100)
Content.IntegrationTests/PoolManager.cs
Content.IntegrationTests/Tests/EntityTest.cs
Content.IntegrationTests/Tests/Interaction/InteractionTest.cs

index d60f6cb4bd1341060c8cfb51b353eb16244c509a..03ebf49a9b260363355be607f2885485c4853c49 100644 (file)
@@ -69,7 +69,6 @@ public static partial class PoolManager
         options.BeforeStart += () =>
         {
             var entSysMan = IoCManager.Resolve<IEntitySystemManager>();
-            var compFactory = IoCManager.Resolve<IComponentFactory>();
             entSysMan.LoadExtraSystemType<ResettingEntitySystemTests.TestRoundRestartCleanupEvent>();
             entSysMan.LoadExtraSystemType<InteractionSystemTests.TestInteractionSystem>();
             entSysMan.LoadExtraSystemType<DeviceNetworkTestSystem>();
index 36a75acc0a4fd41158243294405e3661df87d452..e9a25e9a5109a4ee2d27db4d8921550c4e44aff7 100644 (file)
@@ -216,6 +216,7 @@ namespace Content.IntegrationTests.Tests
         {
             var settings = new PoolSettings { Connected = true, Dirty = true };
             await using var pair = await PoolManager.GetServerClient(settings);
+            var mapManager = pair.Server.ResolveDependency<IMapManager>();
             var server = pair.Server;
             var client = pair.Client;
 
@@ -245,8 +246,15 @@ namespace Content.IntegrationTests.Tests
                 .Select(p => p.ID)
                 .ToList();
 
-            var mapId = await pair.CreateTestMap();
-            var coords = mapId.MapCoords;
+            protoIds.Sort();
+            var mapId = MapId.Nullspace;
+
+            await server.WaitPost(() =>
+            {
+               mapId = mapManager.CreateMap();
+            });
+
+            var coords = new MapCoordinates(Vector2.Zero, mapId);
 
             await pair.RunTicksSync(3);
 
@@ -273,7 +281,9 @@ namespace Content.IntegrationTests.Tests
 
                     if (client.EntMan.EntityCount != clientCount)
                     {
-                        Assert.Fail($"Client prototype {protoId} failed on deleting itself");
+                        Assert.Fail($"Client prototype {protoId} failed on deleting itself\n" +
+                                    $"Expected {clientCount} and found {client.EntMan.EntityCount}.\n" +
+                                    $"Server was {count}.");
                     }
                     continue;
                 }
@@ -286,7 +296,9 @@ namespace Content.IntegrationTests.Tests
 
                 if (client.EntMan.EntityCount <= clientCount)
                 {
-                    Assert.Fail($"Client prototype {protoId} failed on spawning as entity count didn't increase");
+                    Assert.Fail($"Client prototype {protoId} failed on spawning as entity count didn't increase" +
+                                $"Expected at least {clientCount} and found {client.EntMan.EntityCount}. " +
+                                $"Server was {count}");
                 }
 
                 await server.WaitPost(() => server.EntMan.DeleteEntity(uid));
@@ -300,7 +312,9 @@ namespace Content.IntegrationTests.Tests
 
                 if (client.EntMan.EntityCount != clientCount)
                 {
-                    Assert.Fail($"Client prototype {protoId} failed on deletion count didn't reset properly");
+                    Assert.Fail($"Client prototype {protoId} failed on deletion count didn't reset properly:\n" +
+                                $"Expected {clientCount} and found {client.EntMan.EntityCount}.\n" +
+                                $"Server was {count}.");
                 }
             }
 
index d4aa8d58c9cafe2403a22a15ae173360135fdc63..58076454c1a1b9e8230658b125691d41df2b1885 100644 (file)
@@ -140,7 +140,7 @@ public abstract partial class InteractionTest
     [SetUp]
     public virtual async Task Setup()
     {
-        Pair = await PoolManager.GetServerClient(new PoolSettings { Connected = true });
+        Pair = await PoolManager.GetServerClient(new PoolSettings { Connected = true, Dirty = true});
 
         // server dependencies
         SEntMan = Server.ResolveDependency<IEntityManager>();