docs(tests): fix CommentChecker findings across tests/ — 13,392 → 0 (repo-wide scan clean)

Comment/XML-doc changes only:
- add summaries to ~10k test methods, fixtures, fakes and helpers
  (+ <param> on theories, <returns> on async Task methods,
  <inheritdoc/> on interface implementations the checker can resolve)
- strip ~2.6k project-tracking references (WP*, P*-*, row-NN, Task N,
  #NN, Component-0NN) from comments, keeping the explanatory text;
  reword false positives in comments only
- real docs on fakes implementing BCL/library interfaces
  (IDisposable, ILogger, IOptionsMonitor, IAsyncLifetime)
- reword the last 5 src/ false positives (CWE-1236, failures-1,
  year-0001, M365)

Only non-comment edits: four one-line nested classes split across lines
so members can carry docs. Build 0 errors / 0 warnings.
This commit is contained in:
Joseph Doherty
2026-10-07 15:05:49 -04:00
parent 0ffd4bdbea
commit 513fa1aa16
998 changed files with 17896 additions and 2395 deletions
@@ -21,9 +21,9 @@ using IAuditWriter = ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services.IAuditWri
namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Actors;
/// <summary>
/// WP3.1 test group 6 — the per-script in-flight cap and its shed policy.
/// Test group 6 — the per-script in-flight cap and its shed policy.
///
/// <para>Before WP3.1 every trigger spawned another run unconditionally: a trigger firing
/// <para>Previously every trigger spawned another run unconditionally: a trigger firing
/// faster than its script completes produced unbounded fan-out onto a bounded thread pool.
/// The cap (<see cref="SiteRuntimeOptions.MaxConcurrentRunsPerScript"/>, default 4) sheds the
/// NEWEST run instead. Keeping the four already queued/running — which are closest to their
@@ -40,6 +40,7 @@ public class ScriptRunShedTests : TestKit, IDisposable
private readonly SharedScriptLibrary _sharedLibrary;
private readonly ScriptExecutionScheduler _scheduler = new(8);
/// <summary>Creates the shared script library and the gate that blocks scripts so runs stay in flight.</summary>
public ScriptRunShedTests()
{
var compilationService = new ScriptCompilationService(
@@ -49,6 +50,7 @@ public class ScriptRunShedTests : TestKit, IDisposable
ShedHooks.Gate = new SemaphoreSlim(0);
}
/// <inheritdoc />
void IDisposable.Dispose()
{
ShedHooks.Gate.Release(64);
@@ -79,6 +81,7 @@ public class ScriptRunShedTests : TestKit, IDisposable
StuckScriptGraceMs = 120_000
};
/// <summary>Verifies that a fifth concurrent run is shed, counted and reported as a site event once, and the caller is answered with an error.</summary>
[Fact]
public void FifthConcurrentRun_IsShed_Counted_EventedOnce_AndAnsweredWithAnError()
{
@@ -144,6 +147,7 @@ public class ScriptRunShedTests : TestKit, IDisposable
AwaitAssert(() => Assert.Equal(4, actor.UnderlyingActor.RunsInFlight), TimeSpan.FromSeconds(15));
}
/// <summary>Verifies that alarm on-trigger runs are shed at the same cap and produce an alarm-scoped site event.</summary>
[Fact]
public void AlarmOnTriggerRuns_ShedAtTheSameCap_WithAnAlarmScopedSiteEvent()
{
@@ -233,17 +237,24 @@ public class ScriptRunShedTests : TestKit, IDisposable
{
private readonly List<AuditEvent> _events = new();
/// <inheritdoc />
public Task WriteAsync(AuditEvent evt, CancellationToken ct = default)
{
lock (_events) _events.Add(evt);
return Task.CompletedTask;
}
/// <summary>Takes a copy of the rows captured so far.</summary>
/// <returns>An array of the captured audit events.</returns>
public AuditEvent[] Snapshot()
{
lock (_events) return _events.ToArray();
}
/// <summary>Polls until a captured row matches the predicate or the timeout expires.</summary>
/// <param name="predicate">The condition a row must satisfy.</param>
/// <param name="timeout">The maximum time to wait.</param>
/// <returns>The first matching audit event, or null if none matched in time.</returns>
public AuditEvent? WaitFor(Func<AuditEvent, bool> predicate, TimeSpan timeout)
{
var deadline = DateTime.UtcNow + timeout;
@@ -279,6 +290,7 @@ public class ScriptRunShedTests : TestKit, IDisposable
private static bool IsFailedScriptRun(AuditEvent evt) =>
evt.Action == "ScriptTrace.ScriptRun" && evt.AsRow().Status.ToString() == "Failed";
/// <summary>Verifies that a traced run shed at the cap emits a failed script-run row parented to the writer.</summary>
[Fact]
public void TracedRun_ShedAtTheCap_EmitsAFailedScriptRunRow_ParentedToTheWriter()
{
@@ -325,6 +337,7 @@ public class ScriptRunShedTests : TestKit, IDisposable
Assert.Equal(4, actor.UnderlyingActor.RunsInFlight);
}
/// <summary>Verifies that a traced run suppressed by the minimum time between runs emits a failed script-run row.</summary>
[Fact]
public void TracedRun_SuppressedByMinTimeBetweenRuns_EmitsAFailedScriptRunRow()
{