Make tests faster (#8737)
* Test changes * Make finding the test tile a little smarter
This commit is contained in:
@@ -11,7 +11,7 @@ namespace Content.IntegrationTests.Tests
|
||||
// i.e. the interaction between uniforms and the pocket/ID slots.
|
||||
// and also how big items don't fit in pockets.
|
||||
[TestFixture]
|
||||
public sealed class HumanInventoryUniformSlotsTest : ContentIntegrationTest
|
||||
public sealed class HumanInventoryUniformSlotsTest
|
||||
{
|
||||
private const string Prototypes = @"
|
||||
- type: entity
|
||||
@@ -56,8 +56,8 @@ namespace Content.IntegrationTests.Tests
|
||||
[Test]
|
||||
public async Task Test()
|
||||
{
|
||||
var options = new ServerIntegrationOptions{ExtraPrototypes = Prototypes};
|
||||
var server = StartServer(options);
|
||||
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings{NoClient = true, ExtraPrototypes = Prototypes});
|
||||
var server = pairTracker.Pair.Server;
|
||||
|
||||
EntityUid human = default;
|
||||
EntityUid uniform = default;
|
||||
@@ -66,7 +66,7 @@ namespace Content.IntegrationTests.Tests
|
||||
|
||||
InventorySystem invSystem = default!;
|
||||
|
||||
server.Assert(() =>
|
||||
await server.WaitAssertion(() =>
|
||||
{
|
||||
invSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<InventorySystem>();
|
||||
var mapMan = IoCManager.Resolve<IMapManager>();
|
||||
@@ -102,9 +102,9 @@ namespace Content.IntegrationTests.Tests
|
||||
Assert.That(invSystem.TryUnequip(human, "jumpsuit"));
|
||||
});
|
||||
|
||||
server.RunTicks(2);
|
||||
await server.WaitRunTicks(2);
|
||||
|
||||
server.Assert(() =>
|
||||
await server.WaitAssertion(() =>
|
||||
{
|
||||
// Items have been dropped!
|
||||
Assert.That(IsDescendant(uniform, human), Is.False);
|
||||
@@ -117,7 +117,7 @@ namespace Content.IntegrationTests.Tests
|
||||
Assert.That(!invSystem.TryGetSlotEntity(human, "pocket1", out _));
|
||||
});
|
||||
|
||||
await server.WaitIdleAsync();
|
||||
await pairTracker.CleanReturnAsync();
|
||||
}
|
||||
|
||||
private static bool IsDescendant(EntityUid descendant, EntityUid parent)
|
||||
|
||||
Reference in New Issue
Block a user