Don't run GC collect in startup in integration tests.

Oof.
This commit is contained in:
Pieter-Jan Briers
2022-12-09 21:22:23 +01:00
parent c2de890441
commit e71cab167b
4 changed files with 18 additions and 3 deletions
@@ -160,8 +160,11 @@ namespace Robust.Client
_authManager.LoadFromEnv();
GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce;
GC.Collect();
if (_configurationManager.GetCVar(CVars.SysGCCollectStart))
{
GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce;
GC.Collect();
}
// Setup main loop
if (_mainLoop == null)
+4 -1
View File
@@ -377,7 +377,10 @@ namespace Robust.Server
WindowsTickPeriod.TimeBeginPeriod((uint) _config.GetCVar(CVars.SysWinTickPeriod));
}
GC.Collect();
if (_config.GetCVar(CVars.SysGCCollectStart))
{
GC.Collect();
}
ProgramShared.RunExecCommands(_consoleHost, _commandLineArgs?.ExecCommands);
+6
View File
@@ -317,6 +317,12 @@ namespace Robust.Shared
public static readonly CVarDef<int> SysGameThreadPriority =
CVarDef.Create("sys.game_thread_priority", (int) ThreadPriority.AboveNormal);
/// <summary>
/// Whether to run a <see cref="GC.Collect()"/> operation after the engine is finished initializing.
/// </summary>
public static readonly CVarDef<bool> SysGCCollectStart =
CVarDef.Create("sys.gc_collect_start", true);
/*
* METRICS
*/
@@ -650,6 +650,7 @@ namespace Robust.UnitTesting
{
("log.runtimelog", "false"),
(CVars.SysWinTickPeriod.Name, "-1"),
(CVars.SysGCCollectStart.Name, "false"),
(RTCVars.FailureLogLevel.Name, (Options?.FailureLogLevel ?? RTCVars.FailureLogLevel.DefaultValue).ToString())
});
@@ -817,6 +818,8 @@ namespace Robust.UnitTesting
// Avoid preloading textures.
(CVars.ResTexturePreloadingEnabled.Name, "false"),
(CVars.SysGCCollectStart.Name, "false"),
(RTCVars.FailureLogLevel.Name, (Options?.FailureLogLevel ?? RTCVars.FailureLogLevel.DefaultValue).ToString())
});