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:
@@ -7,7 +7,7 @@ using ZB.MOM.WW.ScadaBridge.TestSupport;
|
||||
namespace ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// WP-14 (telemetry follow-on): verifies the cached buffered-message counter that
|
||||
/// Verifies the cached buffered-message counter that
|
||||
/// backs the <c>scadabridge.store_and_forward.queue.depth</c> observable gauge tracks
|
||||
/// the live (Pending) queue across the existing enqueue / drain / park / requeue paths,
|
||||
/// and that the sync gauge callback reports it.
|
||||
@@ -30,6 +30,7 @@ public class QueueDepthGaugeTests : IAsyncLifetime, IDisposable
|
||||
private readonly StoreAndForwardStorage _storage;
|
||||
private readonly StoreAndForwardService _service;
|
||||
|
||||
/// <summary>Initializes the test with a SQLite-backed store-and-forward service.</summary>
|
||||
public QueueDepthGaugeTests()
|
||||
{
|
||||
_localDb = TestLocalDb.CreateTemp("QueueDepthTests");
|
||||
@@ -49,6 +50,8 @@ public class QueueDepthGaugeTests : IAsyncLifetime, IDisposable
|
||||
_storage, options, NullLogger<StoreAndForwardService>.Instance);
|
||||
}
|
||||
|
||||
/// <summary>Prepares the fixture before the tests run.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
public async Task InitializeAsync()
|
||||
{
|
||||
await _storage.InitializeAsync();
|
||||
@@ -57,8 +60,11 @@ public class QueueDepthGaugeTests : IAsyncLifetime, IDisposable
|
||||
await _service.StartAsync();
|
||||
}
|
||||
|
||||
/// <summary>Releases the resources used by this instance asynchronously.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
public async Task DisposeAsync() => await _service.StopAsync();
|
||||
|
||||
/// <summary>Releases the resources used by this instance.</summary>
|
||||
public void Dispose()
|
||||
{
|
||||
var path = _localDb.Path;
|
||||
@@ -91,6 +97,8 @@ public class QueueDepthGaugeTests : IAsyncLifetime, IDisposable
|
||||
return observed;
|
||||
}
|
||||
|
||||
/// <summary>Verifies that gauge, tracks buffered depth, across enqueue drain and park.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Gauge_TracksBufferedDepth_AcrossEnqueueDrainAndPark()
|
||||
{
|
||||
@@ -140,12 +148,13 @@ public class QueueDepthGaugeTests : IAsyncLifetime, IDisposable
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// StoreAndForward-025: after a graceful <see cref="StoreAndForwardService.StopAsync"/>
|
||||
/// After a graceful <see cref="StoreAndForwardService.StopAsync"/>
|
||||
/// the service must deregister its queue-depth provider from the process-global gauge
|
||||
/// slot, so the gauge stops reporting the stopped instance's (now-frozen) depth and the
|
||||
/// provider closure no longer pins the dead service. With the provider cleared the gauge
|
||||
/// falls back to 0.
|
||||
/// </summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task StopAsync_ClearsQueueDepthProvider_GaugeFallsBackToZero()
|
||||
{
|
||||
@@ -176,13 +185,14 @@ public class QueueDepthGaugeTests : IAsyncLifetime, IDisposable
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// StoreAndForward-025 (compare-and-clear): when a newer instance has already
|
||||
/// Compare-and-clear: when a newer instance has already
|
||||
/// registered its provider into the process-global slot, a late
|
||||
/// <see cref="StoreAndForwardService.StopAsync"/> of an older instance must NOT clear
|
||||
/// the slot — the identity-checked clear only removes the slot when it still holds the
|
||||
/// stopping instance's own delegate. After the late stop the gauge must still report
|
||||
/// the newer instance's depth, not 0.
|
||||
/// </summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task StopAsync_DoesNotClobberNewerInstanceProvider()
|
||||
{
|
||||
@@ -218,13 +228,14 @@ public class QueueDepthGaugeTests : IAsyncLifetime, IDisposable
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// StoreAndForward-028: a same-instance Stop→Start must re-seed the cached depth from a
|
||||
/// A same-instance Stop→Start must re-seed the cached depth from a
|
||||
/// clean base. <see cref="StoreAndForwardService.StopAsync"/> resets the one-time
|
||||
/// registration guard so a later <see cref="StoreAndForwardService.StartAsync"/>
|
||||
/// re-registers and re-seeds <c>_bufferedCount</c> from the durable Pending count; if
|
||||
/// StopAsync did not also reset <c>_bufferedCount</c>, the restart would ADD the re-read
|
||||
/// count on top of the leftover in-memory value, double-counting the gauge to ~2N.
|
||||
/// </summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task StartAsync_AfterStop_ReseedsFromCleanBase_NoDoubleCount()
|
||||
{
|
||||
@@ -261,6 +272,8 @@ public class QueueDepthGaugeTests : IAsyncLifetime, IDisposable
|
||||
await svc.StopAsync();
|
||||
}
|
||||
|
||||
/// <summary>Verifies that gauge, seeds from existing pending rows, on start.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Gauge_SeedsFromExistingPendingRows_OnStart()
|
||||
{
|
||||
@@ -313,6 +326,7 @@ public class QueueDepthGaugeTests : IAsyncLifetime, IDisposable
|
||||
/// pre-increments the in-memory counter (standing in for that concurrent enqueue),
|
||||
/// then starts the service over an empty store and asserts the pre-increment survives.
|
||||
/// </summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Gauge_SeedAddsToConcurrentPreSeedIncrement_NotClobber()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user