Repository navigation
test(testing): cover TestingHost failure diagnostics - #10883
Conversation
There was a problem hiding this comment.
Copilot review overview
Review tier: Lite
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
test/Orleans.Reminders.TestKit.Tests/ReminderTestKitDiagnosticsTests.cs — The test file uses TestExtensions attributes (TestSuite/TestProvider/TestArea/TestCategory) but… |
What changed in this PR
This PR adds deterministic tests to increase coverage of Orleans.TestingHost lifecycle failure handling and diagnostic utilities, plus a small set of tests to pin Orleans.Reminders.TestKit failure-report behavior. It aligns with the incremental coverage goals in #10864 by asserting cleanup/idempotency and the exact diagnostic evidence retained on failure.
Changes:
- Add in-process cluster lifecycle tests which simulate silo startup failure, client startup failure, and silo stop failure, asserting cleanup + retained diagnostics.
- Add comprehensive
InMemoryLoggerProvider/InMemoryLogBuffertests for exception formatting, filtering, scopes, concurrency, disposal, truncation/byte sizing, and diagnostics output. - Add
DiagnosticEventCollectortests covering listener filtering, historical vs future waits, predicates, timeout messaging, clearing, and disposal behavior.
| File | Description |
|---|---|
| test/TestInfrastructure/Orleans.TestingHost.Tests/InProcessTestClusterLifecycleTests.cs | New functional tests for in-proc cluster failure paths and disposal/diagnostics behavior. |
| test/TestInfrastructure/Orleans.TestingHost.Tests/InMemoryLoggerProviderTests.cs | New BVT tests validating in-memory logging behavior, formatting, filtering, concurrency, and disposal semantics. |
| test/TestInfrastructure/Orleans.TestingHost.Tests/DiagnosticEventCollectorTests.cs | New BVT tests for diagnostic listener filtering and event waiting/counting behaviors. |
| test/Orleans.Reminders.TestKit.Tests/ReminderTestKitDiagnosticsTests.cs | New tests pinning reminder failure report placeholders and exception propagation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Code coverage78.67% line coverage - 99,604 / 126,605 lines Coverage details
|
There was a problem hiding this comment.
Copilot review overview
Review tier: Lite
Findings: None
Issues resolved since last review (1)
| Severity | Finding |
|---|---|
test/Orleans.Reminders.TestKit.Tests/ReminderTestKitDiagnosticsTests.cs — The test file uses TestExtensions attributes (TestSuite/TestProvider/TestArea/TestCategory) but… View resolved comment |
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
test/TestInfrastructure/Orleans.TestingHost.Tests/InProcessTestClusterLifecycleTests.cs:429
FixedPortAllocatorreturns hard-coded port ranges (20k/30k) instead of probing for free ports and it ignores thenumPortscontract. This can make the new lifecycle tests flaky on shared CI agents when those ports are already in use (startup would fail for the wrong reason).
Consider delegating to the existing TestClusterPortAllocator (which finds unused ports) while still tracking AllocationRequests/DisposeCount.
public (int, int) AllocateConsecutivePortPairs(int numPorts)
{
_allocationRequests.Enqueue(numPorts);
var pair = Interlocked.Increment(ref _nextPortPair);
return (20_000 + pair, 30_000 + pair);

Problem
Orleans.TestingHostlifecycle, logging, and diagnostic infrastructure has significant uncovered failure paths, making regressions in cleanup and failure evidence difficult to detect.Solution
Coverage impact
Orleans.TestingHostInProcTestCluster.csInMemoryLoggerProvider.csPrintExceptionDiagnosticEventCollector.csReminderTestKitDiagnostics.csThis is a mergeable first slice toward #10864. Storage emulator modernization and the remaining package-wide coverage gap remain follow-up work.
Microsoft Reviewers: Open in CodeFlow