From f74c5861f4d770954b371bcf304c1ee1f3735d4d Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Fri, 4 Aug 2023 06:34:51 +1200 Subject: [PATCH] Try fix test failures (#18620) --- .../Tests/Interaction/InteractionTest.cs | 7 ++++++- .../Tests/Toolshed/ToolshedTest.cs | 12 +++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Content.IntegrationTests/Tests/Interaction/InteractionTest.cs b/Content.IntegrationTests/Tests/Interaction/InteractionTest.cs index f3c2a835ca..1ef8c11e0b 100644 --- a/Content.IntegrationTests/Tests/Interaction/InteractionTest.cs +++ b/Content.IntegrationTests/Tests/Interaction/InteractionTest.cs @@ -233,9 +233,14 @@ public abstract partial class InteractionTest } [TearDown] - public virtual async Task Cleanup() + public async Task TearDownInternal() { await Server.WaitPost(() => MapMan.DeleteMap(MapId)); await PairTracker.CleanReturnAsync(); + await TearDown(); + } + + protected virtual async Task TearDown() + { } } diff --git a/Content.IntegrationTests/Tests/Toolshed/ToolshedTest.cs b/Content.IntegrationTests/Tests/Toolshed/ToolshedTest.cs index 54df7b7335..acec048906 100644 --- a/Content.IntegrationTests/Tests/Toolshed/ToolshedTest.cs +++ b/Content.IntegrationTests/Tests/Toolshed/ToolshedTest.cs @@ -11,7 +11,7 @@ using Robust.UnitTesting; namespace Content.IntegrationTests.Tests.Toolshed; [TestFixture] -[FixtureLifeCycle(LifeCycle.SingleInstance)] +[FixtureLifeCycle(LifeCycle.InstancePerTestCase)] public abstract class ToolshedTest : IInvocationContext { protected PairTracker PairTracker = default!; @@ -27,13 +27,19 @@ public abstract class ToolshedTest : IInvocationContext protected IInvocationContext? Context = null; [TearDown] - public virtual async Task TearDown() + public async Task TearDownInternal() + { + await PairTracker.CleanReturnAsync(); + await TearDown(); + } + + protected virtual async Task TearDown() { Assert.IsEmpty(_expectedErrors); ClearErrors(); } - [OneTimeSetUp] + [SetUp] public virtual async Task Setup() { PairTracker = await PoolManager.GetServerClient(new PoolSettings {NoClient = NoClient});