Migrate SOS command coverage - #6017
Merged
Merged
Conversation
Carry the reviewed command tests and cross-platform capability filters onto the stabilized harness layer. Retire the three fully superseded legacy exception scripts while retaining Reflection coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 72ff9a52-4eb6-46f7-a3f9-39b5f99de529
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
It changes multiple cross-cutting test-matrix validity rules and migrates/retunes substantial SOS coverage across platforms and hosts, which warrants final human review for unintended coverage gaps or matrix regressions.
Review tier: Lite
Findings: None
What changed in this PR
This PR migrates legacy, command-focused SOS test coverage into the stabilized SOS.Tests harness, updating the capability/platform matrices and retiring fully superseded legacy exception scripts while preserving specialized legacy coverage where still needed (e.g., reflection boundary behavior and #5985 skips).
Changes:
- Retired legacy
SOS.UnitTestsexception-script entrypoints (DivZero,SimpleThrow,NestedExceptionTest) and removed the corresponding scripts after porting equivalent/stronger assertions intoSOS.Tests. - Refactored and expanded the stabilized harness’s test matrices/capability filters (heap enumeration, current-thread semantics, cDAC SingleFile support on .NET 11+), with focused validation tests.
- Improved/extended parsing and platform-aware assertions (e.g., register name by architecture, x86-specific
gcinfo/clruparsing and expectations, pointer-size-dependent validations).
| File | Description |
|---|---|
| src/tests/SOS.UnitTests/SOS.cs | Removes three legacy exception script test entrypoints now covered by stabilized harness tests. |
| src/tests/SOS.UnitTests/Scripts/SimpleThrow.script | Deleted (retired) legacy script superseded by SOS.Tests coverage. |
| src/tests/SOS.UnitTests/Scripts/NestedExceptionTest.script | Deleted (retired) legacy script superseded by SOS.Tests coverage. |
| src/tests/SOS.UnitTests/Scripts/DivZero.script | Deleted (retired) legacy script superseded by SOS.Tests coverage. |
| src/tests/SOS.UnitTests/Debuggees/SosHarnessScenarios/SosHarnessScenarios.cs | Adds ObjectReference and scenario data to support deterministic notreachableinrange pointer-range scanning. |
| src/tests/SOS.Tests/TestMatrixCapabilityTests.cs | New focused tests validating capability predicates and parsing helpers. |
| src/tests/SOS.Tests/TestMatrices.cs | Adds capability-aware matrix builders and filters; updates stack-walk matrix generation to use predicates and optional filters. |
| src/tests/SOS.Tests/TestConfigValidityTests.cs | Updates cDAC validity expectations (cDAC + SingleFile allowed on .NET 11+) and adds/keeps validity checks. |
| src/tests/SOS.Tests/StackInspectionTests.cs | Uses capability-filtered matrix to avoid invalid “current thread” configurations. |
| src/tests/SOS.Tests/SpecializedInspectionTests.cs | Adds explicit skips for musl and macOS/.NET 11 legacy-DAC syncblk scenario (#5985). |
| src/tests/SOS.Tests/RuntimeInfoTests.cs | Makes registers assertion architecture-aware (esp/rsp/sp). |
| src/tests/SOS.Tests/README.md | Updates harness docs re: cDAC SingleFile support and records legacy retirement criteria/mapping. |
| src/tests/SOS.Tests/PrintExceptionTests.cs | Splits matrices and adds stronger, ordered frame/source-line/inner-exception assertions; adds NoInner + Reflection-focused tests. |
| src/tests/SOS.Tests/ObjectInspectionTests.cs | Fixes object-size assertion to be pointer-size aware (3 * IntPtr.Size). |
| src/tests/SOS.Tests/NativeAddressSpaceTests.cs | Reworks notreachableinrange test to scan an actual object-reference slot and assert only progress/no-results output. |
| src/tests/SOS.Tests/MiscCommandTests.cs | Ensures dbgout is turned off reliably via try/finally; preserves per-host/DAC command availability behavior. |
| src/tests/SOS.Tests/MemoryAndDecodeTests.cs | Adjusts matrix to use heap-enumeration capability filtering and makes pointer/qword dump checks pointer-size aware. |
| src/tests/SOS.Tests/GcWhereTests.cs | Uses capability-filtered matrix for current-thread-dependent commands. |
| src/tests/SOS.Tests/GcInspectionTests.cs | Adds musl + macOS/.NET11 legacy-DAC skips for verifyheap, tweaks stop-point, and strengthens dumpgen MT/object selection logic. |
| src/tests/SOS.Tests/EeHeapTests.cs | Uses per-generation range accessors for clearer assertions across layouts. |
| src/tests/SOS.Tests/EeHeapParsing.cs | Refines regions-layout detection and clarifies documentation comment for IsRegions. |
| src/tests/SOS.Tests/DumpHeapThinLockTests.cs | Adds musl skip where thin-lock data is unavailable from the DAC. |
| src/tests/SOS.Tests/DumpHeapStringsTests.cs | Filters heap-enumeration matrix for environments where heap enumeration is unsupported. |
| src/tests/SOS.Tests/DiagnosticCommandTests.cs | Adds a focused CLRMA exception-chain assertion for NestedException on dotnet-dump. |
| src/tests/SOS.Tests/COVERAGE.md | Updates coverage audit to record retirements and documents the newer dumpgen oracle approach. |
| src/tests/SOS.Tests/CodeInfoTests.cs | Adjusts gcinfo transition expectation for x86 legacy encoding. |
| src/tests/SOS.Tests/CodeCommandParsingTests.cs | New parsing unit tests for clru instruction formats and x86 legacy gcinfo encoding. |
| src/tests/SOS.Tests/CodeCommandParsing.cs | Improves clru parsing with explicit offset-mode handling; extends gcinfo parsing for legacy formats and normalizes transition extraction. |
| src/tests/SOS.Tests/ClrUTests.cs | Makes source-annotation and GC-info expectations architecture/framework aware. |
| src/tests/SOS.Tests/ClrStackTests.cs | Applies capability filter to exclude unsupported GC-root enumeration configurations. |
| src/tests/SOS.Tests/ClrStackLinesTests.cs | Strengthens source-line assertions with per-target expected line sets; broadens liveness coverage for the matrix. |
| src/tests/SOS.Tests/ClrStackICorDebugTests.cs | Uses capability-filtered stack-walk matrix for ICorDebug limitations. |
| src/tests/SOS.TestHarness/TestConfig.cs | Updates cDAC support rules (allow SingleFile on .NET 11+) and clarifies doc comment. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
This was referenced Sep 9, 2026
This was referenced Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation
src/tests/SOS.Tests/SOS.Tests.csprojfor macOS arm64CodeCommandParsingTests,TestMatrixCapabilityTests, andTestConfigValidityTestsSupersedes #6001, whose native stacked-PR metadata could not be repaired after its parent was squash-merged.