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
@@ -10,7 +10,7 @@ using ZB.MOM.WW.ScadaBridge.HealthMonitoring;
namespace ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests.Actors;
/// <summary>
/// WP2.1b — the DataConnectionActor against a batch-capable adapter: chunked subscribe,
/// The DataConnectionActor against a batch-capable adapter: chunked subscribe,
/// chunked/bounded re-subscribe, the seed deadline, batched tag-resolution probes, the
/// partial-failure surface and the coalesced quality push. The existing suite covers the
/// same actor against a NON batch-capable adapter, which keeps the per-tag fallback pinned.
@@ -42,11 +42,12 @@ public class DataConnectionActorBatchTests : TestKit
private static string[] Tags(int count) => Enumerable.Range(1, count).Select(i => $"tag{i}").ToArray();
/// <summary>Verifies that subscribing issues one adapter round trip per chunk rather than one per tag.</summary>
[Fact]
public void Subscribe_IssuesOneAdapterRoundTripPerChunk_NotPerTag()
{
// 12 tags at SubscribeBatchSize 5 → 3 batch calls (5/5/2) and ZERO per-tag
// subscribes. This is finding #3: the old path was one adapter call (and one OPC UA
// subscribes. The old path was one adapter call (and one OPC UA
// ApplyChanges) per tag.
var adapter = new FakeBatchDataConnection();
var actor = CreateActor(adapter, Options(), "batch-chunking");
@@ -60,6 +61,7 @@ public class DataConnectionActorBatchTests : TestKit
Assert.Equal(0, Volatile.Read(ref adapter.SingleSubscribeCalls));
}
/// <summary>Verifies that seeding uses chunked bulk reads rather than per-tag reads.</summary>
[Fact]
public void Seed_UsesChunkedBulkReads_NotPerTagReads()
{
@@ -78,6 +80,7 @@ public class DataConnectionActorBatchTests : TestKit
ExpectMsg<TagValueUpdate>(u => u.Quality == QualityCode.Good, TimeSpan.FromSeconds(5));
}
/// <summary>Verifies that hanging seed reads return at the overall deadline and the subscribe is still acknowledged.</summary>
[Fact]
public void Seed_HangingReads_ReturnAtTheOverallDeadline_AndTheSubscribeIsStillAcked()
{
@@ -102,6 +105,7 @@ public class DataConnectionActorBatchTests : TestKit
ExpectNoMsg(TimeSpan.FromMilliseconds(200));
}
/// <summary>Verifies that a per-tag partial failure marks that tag bad while the request still succeeds.</summary>
[Fact]
public void PartialFailure_PerTagRow_MarksTagBad_ButTheRequestStillSucceeds()
{
@@ -117,6 +121,7 @@ public class DataConnectionActorBatchTests : TestKit
ExpectMsg<SubscribeTagsResponse>(m => m.Success, TimeSpan.FromSeconds(5));
}
/// <summary>Verifies that a batch that throws at connection level fails the request and drives a reconnect.</summary>
[Fact]
public void ThrownBatch_AtConnectionLevel_FailsTheRequestAndDrivesReconnect()
{
@@ -135,6 +140,7 @@ public class DataConnectionActorBatchTests : TestKit
ExpectMsg<ConnectionQualityChanged>(q => q.Quality == QualityCode.Bad, TimeSpan.FromSeconds(5));
}
/// <summary>Verifies that tag-resolution probes are batched rather than issued one per tag.</summary>
[Fact]
public void ResolutionProbes_AreBatched_NotOnePerTag()
{
@@ -162,6 +168,7 @@ public class DataConnectionActorBatchTests : TestKit
Assert.Equal(0, Volatile.Read(ref adapter.SingleSubscribeCalls));
}
/// <summary>Verifies that resolution probes back off so a dead device is not probed at the full rate.</summary>
[Fact]
public void ResolutionProbes_BackOff_SoADeadDeviceIsNotProbedAtFullRate()
{
@@ -196,7 +203,7 @@ public class DataConnectionActorBatchTests : TestKit
}
/// <summary>
/// Row-40 house pattern adapted for a RATE assertion: proves a monotonically-increasing
/// House pattern adapted for a RATE assertion: proves a monotonically-increasing
/// count stays within <c>[minInclusive, maxInclusive]</c> across the whole
/// <paramref name="window"/>, rather than a single blind sleep-then-sample at the end.
/// The upper bound is enforced continuously (fails fast the instant it is exceeded,
@@ -225,7 +232,7 @@ public class DataConnectionActorBatchTests : TestKit
}
/// <summary>
/// Row-40 house pattern for an ABSENCE assertion (mirrors the Medium-wave
/// House pattern for an ABSENCE assertion (mirrors the Medium-wave
/// <c>SiteAlarmAggregatorActorTests.AssertHoldsFor</c> treatment): proves
/// <paramref name="holds"/> keeps being true for the whole <paramref name="window"/> by
/// polling, rather than a single blind <c>Thread.Sleep(window)</c> followed by one
@@ -246,6 +253,7 @@ public class DataConnectionActorBatchTests : TestKit
}
}
/// <summary>Verifies that quality counters are pushed only on a transition and are coalesced.</summary>
[Fact]
public void QualityCounters_ArePushedOnTransitionOnly_AndCoalesced()
{
@@ -279,6 +287,7 @@ public class DataConnectionActorBatchTests : TestKit
"the coalesced push must not repeat");
}
/// <summary>Verifies that quality counters are flushed immediately on disconnect.</summary>
[Fact]
public void QualityCounters_FlushImmediatelyOnDisconnect()
{
@@ -301,6 +310,7 @@ public class DataConnectionActorBatchTests : TestKit
TimeSpan.FromSeconds(3));
}
/// <summary>Verifies that unsubscribing releases every handle in a single round trip.</summary>
[Fact]
public void Unsubscribe_ReleasesEveryHandleInOneRoundTrip()
{
@@ -317,6 +327,7 @@ public class DataConnectionActorBatchTests : TestKit
Assert.Equal(6, released!.Count);
}
/// <summary>Verifies that a reconnect re-subscribes in paced chunks and restores the resolved count.</summary>
[Fact]
public void Reconnect_ReSubscribesInPacedChunks_AndRestoresTheResolvedCount()
{
@@ -353,6 +364,7 @@ public class DataConnectionActorBatchTests : TestKit
TimeSpan.FromSeconds(10));
}
/// <summary>Verifies that a resolution probe completing after an unsubscribe is discarded and its handle released.</summary>
[Fact]
public void ResolutionProbe_CompletingAfterUnsubscribe_IsDiscarded_AndItsHandleIsReleased()
{
@@ -432,6 +444,7 @@ public class DataConnectionActorBatchTests : TestKit
Assert.Equal(0, afterFinalUnsubscribe.ResolvedTags);
}
/// <summary>Verifies that a reconnect re-subscribe completing after an unsubscribe is discarded and its handle released.</summary>
[Fact]
public void ReconnectResubscribe_CompletingAfterUnsubscribe_IsDiscarded_AndItsHandleIsReleased()
{
@@ -483,7 +496,7 @@ public class DataConnectionActorBatchTests : TestKit
// ── Tag-resolution health counts: derived from the per-tag counted set ──
//
// Arch-review remediation residual #1. TotalSubscribedTags / ResolvedTags used to be
// TotalSubscribedTags / ResolvedTags used to be
// two int fields incremented and decremented at five independent sites. The reconnect
// path cleared the very maps those decrements keyed off (_subscriptionIds and
// _unresolvedTags), so an unsubscribe landing inside a reconnect window matched NEITHER
@@ -491,6 +504,7 @@ public class DataConnectionActorBatchTests : TestKit
// under churn. They are now derived at report time from _instancesByTag (the per-tag
// counted set) and _subscriptionIds, which makes that class of drift unrepresentable.
/// <summary>Verifies that an unsubscribe inside a reconnect window does not leak a subscribed tag into the counts.</summary>
[Fact]
public void TagResolutionCounts_UnsubscribeInsideAReconnectWindow_DoesNotLeakASubscribedTag()
{
@@ -546,6 +560,7 @@ public class DataConnectionActorBatchTests : TestKit
}
}
/// <summary>Verifies that a shared tag unsubscribed inside a reconnect window still counts for the other instance.</summary>
[Fact]
public void TagResolutionCounts_SharedTagUnsubscribedInsideAReconnectWindow_StillCountsForTheOtherInstance()
{
@@ -599,6 +614,7 @@ public class DataConnectionActorBatchTests : TestKit
AwaitCondition(() => adapter.UnsubscribeBatches.Any(b => b.Count == 1), TimeSpan.FromSeconds(10));
}
/// <summary>Verifies that after a connection-level failure and recovery the resolved count stays within the total.</summary>
[Fact]
public void TagResolutionCounts_ConnectionLevelFailureThenRecovery_KeepResolvedWithinTheTotal()
{
@@ -645,6 +661,7 @@ public class DataConnectionActorBatchTests : TestKit
Assert.Equal(0, afterUnsubscribe.ResolvedTags);
}
/// <summary>Verifies that tag-resolution counts stay correct across plain subscribe and unsubscribe cycles.</summary>
[Fact]
public void TagResolutionCounts_SurvivePlainSubscribeUnsubscribeCycles()
{
@@ -680,6 +697,7 @@ public class DataConnectionActorBatchTests : TestKit
}
}
/// <summary>Verifies that tag-resolution counts are carried through a completed reconnect re-subscribe.</summary>
[Fact]
public void TagResolutionCounts_AreCarriedThroughACompletedReconnectReSubscribe()
{