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:
+34
-4
@@ -15,12 +15,12 @@ using System.Text.Json;
|
||||
namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Actors;
|
||||
|
||||
/// <summary>
|
||||
/// WP3.1 test group 9 — warm-then-gate deploys and startup batch pre-warm.
|
||||
/// Warm-then-gate deploys and startup batch pre-warm.
|
||||
///
|
||||
/// <para>The site-side compile gate (S3) must stay synchronous on the Deployment Manager's
|
||||
/// thread, because redeploy-supersede and delete-during-redeploy both depend on strict mailbox
|
||||
/// FIFO. But the Roslyn compile it performs used to hold the singleton for the whole
|
||||
/// compilation, stalling every OTHER instance's commands behind one instance's scripts. WP3.1
|
||||
/// compilation, stalling every OTHER instance's commands behind one instance's scripts. The new flow
|
||||
/// warms the compile off-thread first and then re-runs the gate as pure cache hits, with a
|
||||
/// per-instance in-flight guard preserving same-instance ordering.</para>
|
||||
///
|
||||
@@ -44,6 +44,7 @@ public class DeploymentWarmThenGateTests : TestKit, IDisposable
|
||||
private readonly SharedScriptLibrary _sharedScriptLibrary;
|
||||
private readonly TestLocalDb _localDb;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="DeploymentWarmThenGateTests"/> class.</summary>
|
||||
public DeploymentWarmThenGateTests()
|
||||
{
|
||||
_localDb = TestLocalDb.CreateTemp("dm-warm-gate-test");
|
||||
@@ -56,6 +57,7 @@ public class DeploymentWarmThenGateTests : TestKit, IDisposable
|
||||
_compilationService, NullLogger<SharedScriptLibrary>.Instance);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
Shutdown();
|
||||
@@ -95,6 +97,7 @@ public class DeploymentWarmThenGateTests : TestKit, IDisposable
|
||||
{
|
||||
private int _reports;
|
||||
|
||||
/// <summary>Gets the deployed instance count from the most recent <c>SetInstanceCounts</c> call.</summary>
|
||||
public int LastDeployedCount { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -107,29 +110,48 @@ public class DeploymentWarmThenGateTests : TestKit, IDisposable
|
||||
/// value and proves nothing about the manager having started at all.
|
||||
/// </summary>
|
||||
public int ReportCount => Volatile.Read(ref _reports);
|
||||
/// <inheritdoc />
|
||||
public void IncrementScriptError() { }
|
||||
/// <inheritdoc />
|
||||
public void IncrementAlarmError() { }
|
||||
/// <inheritdoc />
|
||||
public void IncrementDeadLetter() { }
|
||||
/// <inheritdoc />
|
||||
public void IncrementSiteAuditWriteFailures() { }
|
||||
/// <inheritdoc />
|
||||
public void IncrementAuditRedactionFailure() { }
|
||||
/// <inheritdoc />
|
||||
public void UpdateSiteAuditBacklog(Commons.Types.SiteAuditBacklogSnapshot snapshot) { }
|
||||
/// <inheritdoc />
|
||||
public void UpdateConnectionHealth(string connectionName, ConnectionHealth health) { }
|
||||
/// <inheritdoc />
|
||||
public void RemoveConnection(string connectionName) { }
|
||||
/// <inheritdoc />
|
||||
public void UpdateTagResolution(string connectionName, int totalSubscribed, int successfullyResolved) { }
|
||||
/// <inheritdoc />
|
||||
public void UpdateConnectionEndpoint(string connectionName, string endpoint) { }
|
||||
/// <inheritdoc />
|
||||
public void UpdateTagQuality(string connectionName, int good, int bad, int uncertain) { }
|
||||
/// <inheritdoc />
|
||||
public void SetStoreAndForwardDepths(IReadOnlyDictionary<string, int> depths) { }
|
||||
/// <inheritdoc />
|
||||
public void SetInstanceCounts(int deployed, int enabled, int disabled)
|
||||
{
|
||||
LastDeployedCount = deployed;
|
||||
Interlocked.Increment(ref _reports);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void SetParkedMessageCount(int count) { }
|
||||
/// <inheritdoc />
|
||||
public void SetNodeHostname(string hostname) { }
|
||||
/// <inheritdoc />
|
||||
public void SetClusterNodes(IReadOnlyList<Commons.Messages.Health.NodeStatus> nodes) { }
|
||||
/// <inheritdoc />
|
||||
public void SetActiveNode(bool isActive) { }
|
||||
/// <inheritdoc />
|
||||
public bool IsActiveNode => true;
|
||||
/// <inheritdoc />
|
||||
public Commons.Messages.Health.SiteHealthReport CollectReport(string siteId)
|
||||
=> throw new NotSupportedException();
|
||||
}
|
||||
@@ -147,6 +169,8 @@ public class DeploymentWarmThenGateTests : TestKit, IDisposable
|
||||
: [new ResolvedScript { CanonicalName = "Worker", Code = scriptCode, TriggerType = "Call" }]
|
||||
});
|
||||
|
||||
/// <summary>Verifies that a delete arriving during the compile warm is queued and applied after the deploy.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task DeleteArrivingDuringTheCompileWarm_IsQueuedAndAppliedAfterTheDeploy()
|
||||
{
|
||||
@@ -177,10 +201,12 @@ public class DeploymentWarmThenGateTests : TestKit, IDisposable
|
||||
// ahead of the warm it would have removed nothing and the deploy would have left the
|
||||
// count at 1. This is the ordering signal rather than the SQLite row, because the
|
||||
// deploy's store and the delete's remove are independent background tasks whose
|
||||
// completion order the actor has never guaranteed (true before WP3.1 as well).
|
||||
// completion order the actor has never guaranteed (true before warm-then-gate as well).
|
||||
AwaitAssert(() => Assert.Equal(0, health.LastDeployedCount), TimeSpan.FromSeconds(10));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a second deploy during the warm supersedes the first and answers its deployer.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task SecondDeployDuringTheWarm_SupersedesTheFirst_AndAnswersItsDeployer()
|
||||
{
|
||||
@@ -212,6 +238,8 @@ public class DeploymentWarmThenGateTests : TestKit, IDisposable
|
||||
Assert.Equal("h2", row.RevisionHash);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that deploys for different instances do not block each other.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task DeploysForDifferentInstances_DoNotBlockEachOther()
|
||||
{
|
||||
@@ -239,12 +267,14 @@ public class DeploymentWarmThenGateTests : TestKit, IDisposable
|
||||
Assert.Contains(configs, c => c.InstanceUniqueName == "PumpY");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that staggered startup pre-warms each batch so the Instance Actor PreStart compiles are cache hits.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task StaggeredStartup_PreWarmsEachBatchSoInstanceActorPreStartCompilesAreCacheHits()
|
||||
{
|
||||
// Two instances sharing one script body. The batch pre-warm compiles it once; the
|
||||
// second config's warm and BOTH Instance Actors' PreStart compiles are then hits.
|
||||
// Before WP3.1 every Instance Actor Roslyn-compiled its own scripts inside PreStart,
|
||||
// Before the batch pre-warm every Instance Actor Roslyn-compiled its own scripts inside PreStart,
|
||||
// serialising a site's whole failover recovery behind compilation.
|
||||
const string sharedCode = "return 41 + 1;";
|
||||
await _storage.StoreDeployedConfigAsync(
|
||||
|
||||
Reference in New Issue
Block a user