mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-15 14:52:35 +02:00
Don't run GC collect in startup in integration tests.
Oof.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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())
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user