Fix parallel tests unreliably failing due to statics in Atmospherics (#1914)
* Fix atmospherics statics unreliably failing parallel tests * Cache getting atmosphere system
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Shared.Atmos;
|
||||
using NUnit.Framework;
|
||||
|
||||
@@ -10,13 +12,17 @@ namespace Content.IntegrationTests.Tests.Atmos
|
||||
public class ConstantsTest : ContentIntegrationTest
|
||||
{
|
||||
[Test]
|
||||
public void TotalGasesTest()
|
||||
public async Task TotalGasesTest()
|
||||
{
|
||||
var server = StartServerDummyTicker();
|
||||
|
||||
await server.WaitIdleAsync();
|
||||
|
||||
var atmosSystem = server.ResolveDependency<AtmosphereSystem>();
|
||||
|
||||
server.Post(() =>
|
||||
{
|
||||
Assert.That(Atmospherics.Gases.Count(), Is.EqualTo(Atmospherics.TotalNumberOfGases));
|
||||
Assert.That(atmosSystem.Gases.Count(), Is.EqualTo(Atmospherics.TotalNumberOfGases));
|
||||
|
||||
Assert.That(Enum.GetValues(typeof(Gas)).Length, Is.EqualTo(Atmospherics.TotalNumberOfGases));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user