Check for GCLatencyMode.NoGCRegion

This test fails occasionaly when run through the automated cake script.  Wrapped the EndNoGCREgion in a check for GCTatencyMode.NoGCRegion to resolve
This commit is contained in:
Christopher Whitley
2023-11-16 01:16:24 -05:00
parent 7701e50f89
commit a5ca7b886f
@@ -35,7 +35,12 @@ namespace MonoGame.Extended.Tests.Collections
Assert.True(false);
}
GC.EndNoGCRegion();
// Wrap in if statement due to exception thrown when running test through
// cake build script or when debugging test script manually.
if(GCSettings.LatencyMode == GCLatencyMode.NoGCRegion)
{
GC.EndNoGCRegion();
}
}
}