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:
@@ -33,7 +33,8 @@ public sealed class GrpcSiteTransportFailoverTests : IAsyncLifetime
|
||||
private SitePairChannelProvider _provider = null!;
|
||||
private volatile bool _preferredReachable;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>Starts the stub servers and builds the channel provider under test.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
public async Task InitializeAsync()
|
||||
{
|
||||
(_hostA, _stubA) = await StartServerAsync();
|
||||
@@ -52,7 +53,8 @@ public sealed class GrpcSiteTransportFailoverTests : IAsyncLifetime
|
||||
_provider.UpdateSite(SiteId, EndpointA, EndpointB);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>Stops the stub servers and disposes the channel provider after the tests.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
public async Task DisposeAsync()
|
||||
{
|
||||
_provider.Dispose();
|
||||
@@ -99,6 +101,8 @@ public sealed class GrpcSiteTransportFailoverTests : IAsyncLifetime
|
||||
},
|
||||
CancellationToken.None);
|
||||
|
||||
/// <summary>Verifies the case: healthy Call, hits Preferred Node A, with Psk And Site Header And Deadline.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task HealthyCall_HitsPreferredNodeA_WithPskAndSiteHeaderAndDeadline()
|
||||
{
|
||||
@@ -113,6 +117,8 @@ public sealed class GrpcSiteTransportFailoverTests : IAsyncLifetime
|
||||
Assert.True(_provider.IsOnPreferredNode(SiteId));
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: not Dispatched, on Node A, fails Over To Node B, and Stays Sticky.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task NotDispatched_OnNodeA_FailsOverToNodeB_AndStaysSticky()
|
||||
{
|
||||
@@ -132,6 +138,8 @@ public sealed class GrpcSiteTransportFailoverTests : IAsyncLifetime
|
||||
Assert.Equal(2, _stubB.LifecycleCalls);
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: failback, returns To Preferred Node A, once Preferred Is Reachable Again.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Failback_ReturnsToPreferredNodeA_OncePreferredIsReachableAgain()
|
||||
{
|
||||
@@ -152,6 +160,8 @@ public sealed class GrpcSiteTransportFailoverTests : IAsyncLifetime
|
||||
Assert.Equal(beforeA + 1, _stubA.LifecycleCalls); // next call back on A
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: deadline Exceeded, on Node A, is Not Retried On Node B.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task DeadlineExceeded_OnNodeA_IsNotRetriedOnNodeB()
|
||||
{
|
||||
@@ -168,6 +178,8 @@ public sealed class GrpcSiteTransportFailoverTests : IAsyncLifetime
|
||||
Assert.True(_provider.IsOnPreferredNode(SiteId), "a deadline must not flip stickiness");
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: ambiguous Unavailable, does Not Replay Lifecycle On Peer.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task AmbiguousUnavailable_DoesNotReplayLifecycleOnPeer()
|
||||
{
|
||||
@@ -181,6 +193,8 @@ public sealed class GrpcSiteTransportFailoverTests : IAsyncLifetime
|
||||
Assert.Equal(0, _stubB.LifecycleCalls);
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: unknown Site, throws, site Channel Unavailable.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task UnknownSite_Throws_SiteChannelUnavailable()
|
||||
{
|
||||
@@ -191,7 +205,9 @@ public sealed class GrpcSiteTransportFailoverTests : IAsyncLifetime
|
||||
|
||||
private sealed class FixedPskProvider(string key) : ISitePskProvider
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public ValueTask<string> GetAsync(string siteId, CancellationToken ct) => new(key);
|
||||
/// <inheritdoc />
|
||||
public void Invalidate(string siteId) { }
|
||||
}
|
||||
|
||||
@@ -199,13 +215,18 @@ public sealed class GrpcSiteTransportFailoverTests : IAsyncLifetime
|
||||
private sealed class StubSiteCommandService : SiteCommandService.SiteCommandServiceBase
|
||||
{
|
||||
private int _lifecycleCalls;
|
||||
/// <summary>Gets the number of lifecycle calls received.</summary>
|
||||
public int LifecycleCalls => Volatile.Read(ref _lifecycleCalls);
|
||||
/// <summary>Gets the authorization header of the last call received.</summary>
|
||||
public string? LastAuthHeader { get; private set; }
|
||||
/// <summary>Gets the site header of the last call received.</summary>
|
||||
public string? LastSiteHeader { get; private set; }
|
||||
/// <summary>Gets a value indicating whether the last call carried a deadline.</summary>
|
||||
public bool DeadlineWasSet { get; private set; }
|
||||
public volatile bool RejectBeforeDispatch;
|
||||
public StatusCode? StatusToThrow;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Task<LifecycleReply> ExecuteLifecycle(LifecycleRequest request, ServerCallContext context)
|
||||
{
|
||||
Interlocked.Increment(ref _lifecycleCalls);
|
||||
|
||||
Reference in New Issue
Block a user