Skip to content

Commit

Permalink
Try fix random shuttle test failures (space-wizards#27186)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectroJr authored Apr 20, 2024
1 parent 5d80e49 commit c4f0502
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Content.IntegrationTests/Pair/TestPair.Recycle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public async Task CleanPooledPair(PoolSettings settings, TextWriter testOut)
// Move to pre-round lobby. Required to toggle dummy ticker on and off
if (gameTicker.RunLevel != GameRunLevel.PreRoundLobby)
{
await testOut.WriteLineAsync($"Recycling: {Watch.Elapsed.TotalMilliseconds} ms: Restarting server.");
await testOut.WriteLineAsync($"Recycling: {Watch.Elapsed.TotalMilliseconds} ms: Restarting round.");
Assert.That(gameTicker.DummyTicker, Is.False);
Server.CfgMan.SetCVar(CCVars.GameLobbyEnabled, true);
await Server.WaitPost(() => gameTicker.RestartRound());
Expand All @@ -146,6 +146,7 @@ public async Task CleanPooledPair(PoolSettings settings, TextWriter testOut)

// Restart server.
await testOut.WriteLineAsync($"Recycling: {Watch.Elapsed.TotalMilliseconds} ms: Restarting server again");
await Server.WaitPost(() => Server.EntMan.FlushEntities());
await Server.WaitPost(() => gameTicker.RestartRound());
await RunTicksSync(1);

Expand Down
5 changes: 4 additions & 1 deletion Content.IntegrationTests/Tests/PostMapInitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ public async Task NoSavedPostMapInitTest()
[Test, TestCaseSource(nameof(GameMaps))]
public async Task GameMapsLoadableTest(string mapProto)
{
await using var pair = await PoolManager.GetServerClient();
await using var pair = await PoolManager.GetServerClient(new PoolSettings
{
Dirty = true // Stations spawn a bunch of nullspace entities and maps like centcomm.
});
var server = pair.Server;

var mapManager = server.ResolveDependency<IMapManager>();
Expand Down
3 changes: 3 additions & 0 deletions Content.IntegrationTests/Tests/Station/EvacShuttleTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public async Task EmergencyEvacTest()
var entMan = server.EntMan;
var ticker = server.System<GameTicker>();

// Dummy ticker tests should not have centcomm
Assert.That(entMan.Count<StationCentcommComponent>(), Is.Zero);

var shuttleEnabled = pair.Server.CfgMan.GetCVar(CCVars.EmergencyShuttleEnabled);
pair.Server.CfgMan.SetCVar(CCVars.GameMap, "Saltern");
pair.Server.CfgMan.SetCVar(CCVars.GameDummyTicker, false);
Expand Down

0 comments on commit c4f0502

Please sign in to comment.