Fix broken tests directly mutating entities from wrong thread. (#31647)
* Fix broken tests directly mutating entities from wrong thread. * fix build * gundam * stuff --------- Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
committed by
GitHub
parent
8ca4337bd8
commit
2d43bb6b38
@@ -32,8 +32,7 @@ public sealed class ActionPvsDetachTest
|
||||
// PVS-detach action entities
|
||||
// We do this by just giving them the ghost layer
|
||||
var visSys = server.System<VisibilitySystem>();
|
||||
|
||||
await server.WaitPost(() =>
|
||||
server.Post(() =>
|
||||
{
|
||||
var enumerator = server.Transform(ent).ChildEnumerator;
|
||||
while (enumerator.MoveNext(out var child))
|
||||
@@ -41,7 +40,6 @@ public sealed class ActionPvsDetachTest
|
||||
visSys.AddLayer(child, (int) VisibilityFlags.Ghost);
|
||||
}
|
||||
});
|
||||
|
||||
await pair.RunTicksSync(5);
|
||||
|
||||
// Client's actions have left been detached / are out of view, but action comp state has not changed
|
||||
@@ -49,7 +47,7 @@ public sealed class ActionPvsDetachTest
|
||||
Assert.That(cSys.GetActions(cEnt).Count(), Is.EqualTo(initActions));
|
||||
|
||||
// Re-enter PVS view
|
||||
await server.WaitPost(() =>
|
||||
server.Post(() =>
|
||||
{
|
||||
var enumerator = server.Transform(ent).ChildEnumerator;
|
||||
while (enumerator.MoveNext(out var child))
|
||||
|
||||
@@ -253,12 +253,12 @@ public sealed class CargoTest
|
||||
{
|
||||
await using var pair = await PoolManager.GetServerClient();
|
||||
var server = pair.Server;
|
||||
|
||||
var entManager = server.ResolveDependency<IEntityManager>();
|
||||
var priceSystem = entManager.System<PricingSystem>();
|
||||
|
||||
await server.WaitAssertion(() =>
|
||||
{
|
||||
var priceSystem = entManager.System<PricingSystem>();
|
||||
|
||||
var ent = entManager.SpawnEntity("StackEnt", MapCoordinates.Nullspace);
|
||||
var price = priceSystem.GetPrice(ent);
|
||||
Assert.That(price, Is.EqualTo(100.0));
|
||||
|
||||
Reference in New Issue
Block a user