Skip to content

Migrate SOS command coverage - #6017

Merged
steveisok merged 1 commit into
mainfrom
steveisok-sos-coverage-migration-standalone
Sep 9, 2026
Merged

Migrate SOS command coverage#6017
steveisok merged 1 commit into
mainfrom
steveisok-sos-coverage-migration-standalone

Conversation

@steveisok

Copy link
Copy Markdown
Member

Summary

  • migrate command-focused SOS coverage and parsing tests onto the stabilized harness
  • correct platform and capability matrices while preserving the stabilized process, path, capture, and configuration work
  • retire the three fully superseded legacy exception scripts while retaining specialized Reflection coverage and issue Legacy DAC SyncBlock data is unavailable for macOS x64 .NET 11 dumps #5985 skips

Validation

  • restored and built src/tests/SOS.Tests/SOS.Tests.csproj for macOS arm64
  • passed all 27 focused CodeCommandParsingTests, TestMatrixCapabilityTests, and TestConfigValidityTests

Supersedes #6001, whose native stacked-PR metadata could not be repaired after its parent was squash-merged.

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
Copilot AI lite review requested due to automatic review settings September 9, 2026 17:16
@steveisok
steveisok requested a review from a team as a code owner September 9, 2026 17:16
@steveisok
steveisok merged commit 0602a31 into main Sep 9, 2026
2 of 17 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.UnitTests exception-script entrypoints (DivZero, SimpleThrow, NestedExceptionTest) and removed the corresponding scripts after porting equivalent/stronger assertions into SOS.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/clru parsing 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants