mbproxy: strip historical phase/wave/plan references from source comments
Comments described the *history* of how the code arrived (phase numbers, wave IDs, review IDs, dated TODOs) instead of what it does today. That scaffolding rotted as the codebase evolved. Cleaned 60 source files + .gitignore; behaviour unchanged (387/387 tests still pass). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -282,12 +282,12 @@ public sealed class ConfigReconcilerTests : IAsyncDisposable
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Phase 12 (W3 test gap #16) — stress-test the W2.3 ConcurrentDictionary fix and the
|
||||
/// W2.1 coalescing-accessor wiring. Many concurrent Apply calls drive add/remove of
|
||||
/// many distinct PLCs; without W2.3's ConcurrentDictionary the inner Task.WhenAll
|
||||
/// continuations would corrupt the dictionary and crash with KeyNotFoundException or
|
||||
/// ArgumentException. The test asserts: all applies complete, no exceptions are
|
||||
/// thrown, and the reload counter is exactly the apply count.
|
||||
/// Stress-tests the live supervisor dictionary and the coalescing-accessor wiring.
|
||||
/// Many concurrent Apply calls drive add/remove of many distinct PLCs; the inner
|
||||
/// Task.WhenAll continuations must not corrupt the dictionary or crash with
|
||||
/// KeyNotFoundException or ArgumentException. The test asserts: all applies
|
||||
/// complete, no exceptions are thrown, and the reload counter is exactly the
|
||||
/// apply count.
|
||||
/// </summary>
|
||||
[Fact(Timeout = 30_000)]
|
||||
public async Task Apply_ManyConcurrentReloads_With_PlcChurn_NoCorruption()
|
||||
@@ -305,7 +305,7 @@ public sealed class ConfigReconcilerTests : IAsyncDisposable
|
||||
|
||||
// Build 8 different option snapshots, each a different PLC roster.
|
||||
// Each Apply will trigger Add+Remove churn against the live supervisor dict —
|
||||
// exactly the path that W2.3's ConcurrentDictionary was needed for.
|
||||
// exactly the path that the ConcurrentDictionary guards against corruption.
|
||||
const int snapshots = 8;
|
||||
const int plcsPerSnapshot = 4;
|
||||
var snaps = new MbproxyOptions[snapshots];
|
||||
@@ -324,8 +324,8 @@ public sealed class ConfigReconcilerTests : IAsyncDisposable
|
||||
using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(25));
|
||||
|
||||
// Fire 16 concurrent applies cycling through the 8 snapshots so each is
|
||||
// submitted twice. Inner per-PLC Task.WhenAll continuations from W2.3 will run
|
||||
// in parallel and stress-test the dictionary mutation safety.
|
||||
// submitted twice. Inner per-PLC Task.WhenAll continuations run in parallel
|
||||
// and stress-test the dictionary mutation safety.
|
||||
var tasks = Enumerable.Range(0, 16)
|
||||
.Select(i => Task.Run(() => reconciler.ApplyAsync(snaps[i % snapshots], cts.Token), cts.Token))
|
||||
.ToArray();
|
||||
|
||||
@@ -320,10 +320,10 @@ public sealed class HotReloadE2ETests : IAsyncLifetime
|
||||
await host.StopAsync(stopCts.Token);
|
||||
}
|
||||
|
||||
// ── Phase 12 (W3 test gap) — cache flush on tag-list reload ─────────────────────────
|
||||
// ── cache flush on tag-list reload ──────────────────────────────────────────────────
|
||||
|
||||
/// <summary>
|
||||
/// W2.8 / W3 — verifies that a tag-list reload for a PLC with a cacheable tag emits
|
||||
/// Verifies that a tag-list reload for a PLC with a cacheable tag emits
|
||||
/// <c>mbproxy.cache.flushed</c>. The cache count is 0 (no real backend to populate
|
||||
/// it), but the event must still fire — it's the operator's signal that the in-memory
|
||||
/// cache state was reset by a config reload.
|
||||
@@ -363,13 +363,13 @@ public sealed class HotReloadE2ETests : IAsyncLifetime
|
||||
await host.StopAsync(stopCts.Token);
|
||||
}
|
||||
|
||||
// ── Phase 12 (W3 test gap #10) — ReadCoalescing.Enabled hot-reload flip ─────────────
|
||||
// ── ReadCoalescing.Enabled hot-reload flip ──────────────────────────────────────────
|
||||
|
||||
/// <summary>
|
||||
/// W3 — verifies that flipping <c>Mbproxy.Resilience.ReadCoalescing.Enabled</c> at
|
||||
/// Verifies that flipping <c>Mbproxy.Resilience.ReadCoalescing.Enabled</c> at
|
||||
/// runtime via hot-reload propagates to the live <see cref="IOptionsMonitor{T}"/>
|
||||
/// snapshot. The W2.1 fix wires the accessor through to add/restart supervisors;
|
||||
/// the multiplexer reads it per-PDU. Proving the IOptionsMonitor sees the new value
|
||||
/// snapshot. The accessor is wired through to add/restart supervisors; the
|
||||
/// multiplexer reads it per-PDU. Proving the IOptionsMonitor sees the new value
|
||||
/// is sufficient — the per-PDU read path is unit-tested at the multiplexer level.
|
||||
/// </summary>
|
||||
[Fact(Timeout = 8_000)]
|
||||
|
||||
@@ -156,10 +156,10 @@ public sealed class ReloadValidatorTests
|
||||
Assert.Contains(errors, e => e.Contains("non-empty"));
|
||||
}
|
||||
|
||||
// ── Phase 12 (W2.10) — Cache.AllowLongTtl gate ──────────────────────────────────────
|
||||
// ── Cache.AllowLongTtl gate ─────────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>
|
||||
/// W2 — per-tag CacheTtlMs > 60_000 without Cache.AllowLongTtl is rejected.
|
||||
/// Per-tag CacheTtlMs > 60_000 without Cache.AllowLongTtl is rejected.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void Validate_PerTagCacheTtl_Above60s_Without_AllowLongTtl_Fails()
|
||||
@@ -181,7 +181,7 @@ public sealed class ReloadValidatorTests
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// W2 — same value passes when AllowLongTtl is true (operator opt-in).
|
||||
/// Same value passes when AllowLongTtl is true (operator opt-in).
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void Validate_PerTagCacheTtl_Above60s_With_AllowLongTtl_Passes()
|
||||
@@ -203,9 +203,9 @@ public sealed class ReloadValidatorTests
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// W2 — per-PLC DefaultCacheTtlMs > 60_000 inherited by a tag with null CacheTtlMs is
|
||||
/// caught by the resolved-value check even if the per-PLC default check itself passes
|
||||
/// (it doesn't, but this validates the defensive resolved re-check from W2.10).
|
||||
/// Per-PLC DefaultCacheTtlMs > 60_000 inherited by a tag with null CacheTtlMs is
|
||||
/// caught by the resolved-value check even if the per-PLC default check itself
|
||||
/// passes (it doesn't, but this validates the defensive resolved re-check).
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void Validate_ResolvedTtl_FromPerPlcDefault_AboveCap_Fails()
|
||||
@@ -233,7 +233,7 @@ public sealed class ReloadValidatorTests
|
||||
Assert.Contains(errors, e => e.Contains("60_000"));
|
||||
}
|
||||
|
||||
// ── Phase 12 (W2.18) — ConnectionOptions validation ─────────────────────────────────
|
||||
// ── ConnectionOptions validation ────────────────────────────────────────────────────
|
||||
|
||||
[Fact]
|
||||
public void Validate_ZeroBackendConnectTimeoutMs_Fails()
|
||||
|
||||
Reference in New Issue
Block a user