Add some tests and fix some miscellaneous bugs (#22836)

* Add some tests and fix some bugs

* Add more helper methods

* remove submodule

* fix merge

* also fix DirtyAll()

* poke
This commit is contained in:
Leon Friedrich
2023-12-27 18:05:20 -05:00
committed by GitHub
parent 44adc32613
commit 35ba42af9c
14 changed files with 292 additions and 37 deletions

View File

@@ -36,8 +36,15 @@ public sealed class PoolTestLogHandler : ILogHandler
_prefix = prefix != null ? $"{prefix}: " : "";
}
public bool ShuttingDown;
public void Log(string sawmillName, LogEvent message)
{
var level = message.Level.ToRobust();
if (ShuttingDown && (FailureLevel == null || level < FailureLevel))
return;
if (ActiveContext is not { } testContext)
{
// If this gets hit it means something is logging to this instance while it's "between" tests.
@@ -45,7 +52,6 @@ public sealed class PoolTestLogHandler : ILogHandler
throw new InvalidOperationException("Log to pool test log handler without active test context");
}
var level = message.Level.ToRobust();
var name = LogMessage.LogLevelToName(level);
var seconds = _stopwatch.Elapsed.TotalSeconds;
var rendered = message.RenderMessage();