diff --git a/Content.IntegrationTests/Tests/RoundEndTest.cs b/Content.IntegrationTests/Tests/RoundEndTest.cs index eaa1c6d1b9..3e0c977051 100644 --- a/Content.IntegrationTests/Tests/RoundEndTest.cs +++ b/Content.IntegrationTests/Tests/RoundEndTest.cs @@ -17,19 +17,26 @@ namespace Content.IntegrationTests.Tests [Test] public async Task Test() { - await using var pairTracker = await PoolManager.GetServerClient(); + await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings() + { + NoClient = true, + }); var server = pairTracker.Pair.Server; + var config = server.ResolveDependency(); + var sysManager = server.ResolveDependency(); + var ticker = sysManager.GetEntitySystem(); + var roundEndSystem = sysManager.GetEntitySystem(); + var eventCount = 0; await server.WaitAssertion(() => { - var ticker = IoCManager.Resolve().GetEntitySystem(); ticker.RestartRound(); - var config = IoCManager.Resolve(); config.SetCVar(CCVars.GameLobbyEnabled, true); + config.SetCVar(CCVars.EmergencyShuttleTransitTime, 1f); + config.SetCVar(CCVars.EmergencyShuttleDockTime, 1f); - var roundEndSystem = IoCManager.Resolve().GetEntitySystem(); roundEndSystem.DefaultCooldownDuration = TimeSpan.FromMilliseconds(250); roundEndSystem.DefaultCountdownDuration = TimeSpan.FromMilliseconds(500); roundEndSystem.DefaultRestartRoundDuration = TimeSpan.FromMilliseconds(250); @@ -41,7 +48,7 @@ namespace Content.IntegrationTests.Tests bus.SubscribeEvent(EventSource.Local, this, _ => { Interlocked.Increment(ref eventCount); }); - var roundEndSystem = IoCManager.Resolve().GetEntitySystem(); + // Press the shuttle call button roundEndSystem.RequestRoundEnd(); Assert.That(roundEndSystem.ExpectedCountdownEnd, Is.Not.Null, "Shuttle was called, but countdown time was not set"); @@ -55,8 +62,6 @@ namespace Content.IntegrationTests.Tests await server.WaitAssertion(() => { - var roundEndSystem = IoCManager.Resolve().GetEntitySystem(); - Assert.That(roundEndSystem.CanCall(), Is.True, "We waited a while, but the cooldown is not expired"); Assert.That(roundEndSystem.ExpectedCountdownEnd, Is.Not.Null, "We were waiting for the cooldown, but the round also ended"); // Recall the shuttle, which should trigger the cooldown again @@ -69,7 +74,6 @@ namespace Content.IntegrationTests.Tests await server.WaitAssertion(() => { - var roundEndSystem = IoCManager.Resolve().GetEntitySystem(); Assert.That(roundEndSystem.CanCall(), Is.True, "We waited a while, but the cooldown is not expired"); // Press the shuttle call button roundEndSystem.RequestRoundEnd(); @@ -79,7 +83,6 @@ namespace Content.IntegrationTests.Tests await server.WaitAssertion(() => { - var roundEndSystem = IoCManager.Resolve().GetEntitySystem(); Assert.That(roundEndSystem.CanCall(), Is.True, "We waited a while, but the cooldown is not expired"); Assert.That(roundEndSystem.ExpectedCountdownEnd, Is.Not.Null, "The countdown ended, but we just wanted the cooldown to end"); }); @@ -96,14 +99,13 @@ namespace Content.IntegrationTests.Tests { return server.WaitAssertion(() => { - var ticker = IoCManager.Resolve().GetEntitySystem(); Assert.That(ticker.RunLevel, Is.EqualTo(level)); }); } async Task WaitForEvent() { - var timeout = Task.Delay(TimeSpan.FromSeconds(60)); + var timeout = Task.Delay(TimeSpan.FromSeconds(10)); var currentCount = Thread.VolatileRead(ref eventCount); while (currentCount == Thread.VolatileRead(ref eventCount) && !timeout.IsCompleted) {