Skip to content

Reapply new SOS test harness - #6008

Merged
steveisok merged 6 commits into
mainfrom
steveisok-reapply-sos-test-harness
Sep 4, 2026
Merged

Reapply new SOS test harness#6008
steveisok merged 6 commits into
mainfrom
steveisok-reapply-sos-test-harness

Conversation

@steveisok

@steveisok steveisok commented Sep 4, 2026

Copy link
Copy Markdown
Member

Summary

  • Restores the complete reviewed SOS test harness from #5979 after its exact revert in #6006.
  • Re-establishes this change as the new bottom layer beneath #5999, #6000, #6001, and #6002.
  • Temporarily excludes only SOS.Tests from local CI via SkipTests when ContinuousIntegrationBuild is true. Normal local builds and discovery remain enabled until the upper Helix layer moves execution out of local CI.

Reconstruction proof

  • The baseline restoration commit 2c7616acc2be6b20cf377574fa52e40196f16ca7 has tree 5d2ab7a6990a8cdc2ff8a3d2ec7a29e373b99d54, exactly matching the pre-revert commit ec5af2a1a56c4d9348e7e92438bb2faf8684f15f.
  • The only subsequent delta is five added lines in src/tests/SOS.Tests/SOS.Tests.csproj for the temporary CI-only skip.

Validation

  • ./dotnet.sh build src/tests/SOS.Tests/SOS.Tests.csproj --no-restore --verbosity minimal — succeeds with 0 warnings and 0 errors.
  • Focused Microsoft.Testing.Platform discovery for SOS.Tests.PrintExceptionTests.PrintException_Data with DotnetDump/Core/net10 constraints — 2 expected rows discovered without ContinuousIntegrationBuild.
  • MSBuild property evaluation: default SkipTests is empty; -p:ContinuousIntegrationBuild=true evaluates SkipTests=true.

This reverts commit 1b5667c, restoring the reviewed #5979 baseline.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 4, 2026 01:53
@steveisok
steveisok requested a review from a team as a code owner September 4, 2026 01:53

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

🟡 Changes recommended

The current diffs include a couple of concrete issues that can cause incorrect behavior or hangs (unbounded dotnet-dump wait in the debuggee snapshot path, incorrect Windows registry view pathing, and an ineffective attempt to isolate publish intermediates).

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Lite
Findings: 1 High severity · 3 Medium severity

New issues introduced by this change (4)
Severity Finding
High severity src/​tests/​Debuggees.proj — The MSBuild call claims to isolate restore/publish by setting ArtifactsObjDir=..., but this…
Medium severity src/​tests/​SOS.TestHarness/​DumpGenerationRequirements.cs — Using an explicit SOFTWARE\\WOW6432Node\\... prefix when running in an x86 process will read the…
Medium severity src/​tests/​SOS.UnitTests/​Debuggees/​SosHarnessScenarios/​TestHarness.cscaptureDir is used to build outPath, but the directory may not exist. If it doesn't,…
Medium severity src/​tests/​SOS.UnitTests/​Debuggees/​SosHarnessScenarios/​TestHarness.csp.WaitForExit() has no timeout/cancellation. If dotnet-dump collect hangs (e.g., IPC failure),…
What changed in this PR

Restores the SOS v3/Microsoft.Testing.Platform-based test harness stack, including the reusable harness library, debuggee publishing workflow, and a broad suite of SOS command coverage tests across hosts/flavors/runtime versions.

Changes:

  • Adds the SOS.TestHarness library (hosts + parsing/assertion utilities) plus engine/capture helper executables.
  • Adds the SOS.Tests xUnit v3 test project with extensive command-coverage test cases and matrix helpers.
  • Publishes SOS single-file debuggees during the build to support the harness’s scenario coverage.
File Description
src/​tests/​SOS.UnitTests/​Debuggees/​SosHarnessScenarios/​TestHarness.cs Debuggee-side stop marker + optional self-snapshot via dotnet-dump
src/​tests/​SOS.UnitTests/​Debuggees/​SosHarnessScenarios/​SosHarnessScenarios.csproj Scenario debuggee project definition (multi-TFM)
src/​tests/​SOS.UnitTests/​Debuggees/​Directory.Build.props Debuggee build props + publish-time runtime.version stamping
src/​tests/​SOS.Tests/​WindowsTheoryAttribute.cs Windows-only theory attribute/discoverer
src/​tests/​SOS.Tests/​TestObjectHelpers.cs Shared object-location helpers for tests
src/​tests/​SOS.Tests/​TestMatrices.cs Matrix helpers (stackwalk, full-dump-on-version, etc.)
src/​tests/​SOS.Tests/​StackInspectionTests.cs Tests for stack-inspection commands
src/​tests/​SOS.Tests/​SpecializedInspectionTests.cs Tests for specialized runtime-state inspection commands
src/​tests/​SOS.Tests/​SosTheoryAttribute.cs Cross-platform theory attribute for SOS tests
src/​tests/​SOS.Tests/​SOS.Tests.csproj SOS.Tests xUnit v3 executable test project wiring
src/​tests/​SOS.Tests/​RuntimeInfoTests.cs Tests for runtime/module/process listing commands
src/​tests/​SOS.Tests/​PrintExceptionTests.cs printexception structure + data tests
src/​tests/​SOS.Tests/​ObjectGcHelperTests.cs Tests for per-object GC helper commands
src/​tests/​SOS.Tests/​ObjectFieldsTests.cs dumpobj/dumpvc field/value assertions
src/​tests/​SOS.Tests/​NativeAddressSpaceTests.cs notreachableinrange coverage
src/​tests/​SOS.Tests/​ModuleResolveTests.cs name2ee/token2ee resolution tests
src/​tests/​SOS.Tests/​MiscCommandTests.cs Session/diagnostic command smoke tests
src/​tests/​SOS.Tests/​MemoryAndDecodeTests.cs Memory dumpers + threadstate/taskstate/dumpexceptions tests
src/​tests/​SOS.Tests/​LiveBpmdTests.cs Live bpmd breakpoint plumbing test
src/​tests/​SOS.Tests/​HeapAnalysisTests.cs sizestats/traverseheap/ephrefs/ephtoloh tests
src/​tests/​SOS.Tests/​GcWhereTests.cs gcwhere dump/live generation checks
src/​tests/​SOS.Tests/​EeHeapTests.cs eeheap -gc structural parsing tests
src/​tests/​SOS.Tests/​DumpSigTests.cs dumpsig/dumpsigelem coverage
src/​tests/​SOS.Tests/​DumpModuleTests.cs dumpmodule structure + -mt tests
src/​tests/​SOS.Tests/​DumpIlTests.cs dumpil decoding tests
src/​tests/​SOS.Tests/​DumpHeapThinLockTests.cs dumpheap -thinlock coverage
src/​tests/​SOS.Tests/​DumpHeapStringsTests.cs dumpheap -strings/-stat content checks
src/​tests/​SOS.Tests/​DumpHeapObjectsTests.cs dumpheap flags/statistics/size filter coverage
src/​tests/​SOS.Tests/​DumpHeapLiveDeadTests.cs dumpheap -live/-dead coverage
src/​tests/​SOS.Tests/​DumpHeapGenerationsTests.cs dumpheap generation/region filtering tests
src/​tests/​SOS.Tests/​DumpDomainTests.cs dumpdomain/dumpassembly round-trip tests
src/​tests/​SOS.Tests/​DumpDelegateTests.cs dumpdelegate coverage
src/​tests/​SOS.Tests/​DumpArrayTests.cs dumparray flags/edge-case coverage
src/​tests/​SOS.Tests/​DiagnosticCommandTests.cs dumpgcdata/sosstatus/logging/clrma tests
src/​tests/​SOS.Tests/​CollectionQueueTests.cs dumpconcurrentqueue/threadpoolqueue tests
src/​tests/​SOS.Tests/​CodeInfoTests.cs ehinfo/gcinfo coverage
src/​tests/​SOS.Tests/​ClrUTests.cs !clru coverage (cdb-only)
src/​tests/​SOS.Tests/​ClrThreadsTests.cs !clrthreads coverage
src/​tests/​SOS.Tests/​ClrThreadsParsing.cs clrthreads table parser
src/​tests/​SOS.Tests/​ClrStackLinesTests.cs clrstack source-line and -n self-consistency tests
src/​tests/​SOS.Tests/​ClrStackICorDebugTests.cs clrstack -i/-i -a coverage
src/​tests/​SOS.Tests/​ClrStackFullTests.cs clrstack -f cross-variant assertions
src/​tests/​SOS.Tests/​ClrStackFrameCountTests.cs clrstack -c N truncation tests
src/​tests/​SOS.Tests/​ClrStackArgsLocalsTests.cs clrstack -p/-l/-a cross-variant/value tests
src/​tests/​SOS.Tests/​ClrStackAllThreadsTests.cs clrstack -all coverage
src/​tests/​SOS.TestHarness/​Targets.cs Target session registry/memoization + teardown
src/​tests/​SOS.TestHarness/​Target.cs Target abstraction + replay capture hooks
src/​tests/​SOS.TestHarness/​SosToken.cs Token shapes for nondeterministic SOS values
src/​tests/​SOS.TestHarness/​SosTable.cs Fixed-width table parsing + fluent assertions
src/​tests/​SOS.TestHarness/​SosRow.cs Row model + added columns + structured data rows
src/​tests/​SOS.TestHarness/​SosDataRowExtensions.cs Assertion helpers over structured data rows
src/​tests/​SOS.TestHarness/​SosDataRow.cs Structured per-row data record model
src/​tests/​SOS.TestHarness/​SosDataExtractor.cs Delegate for extracting internal-data lines
src/​tests/​SOS.TestHarness/​SosConvert.cs Shared numeric/boolean converters with rich failures
src/​tests/​SOS.TestHarness/​SosColumn.cs Column spec + alignment helpers
src/​tests/​SOS.TestHarness/​SosCell.cs Cell wrapper with parsing helpers + rich failures
src/​tests/​SOS.TestHarness/​SosAssertException.cs Rich assertion exception format
src/​tests/​SOS.TestHarness/​SOS.TestHarness.csproj Harness library project + dependencies
src/​tests/​SOS.TestHarness/​ReplayContext.cs Per-test replay timeline capture
src/​tests/​SOS.TestHarness/​lldbhelper.py LLDB command framing helper (sentinel-based)
src/​tests/​SOS.TestHarness/​LldbCliHost.cs LLDB core-file host wiring + DAC routing
src/​tests/​SOS.TestHarness/​Liveness.cs Liveness axis definition
src/​tests/​SOS.TestHarness/​ILiveDebuggerHost.cs Live host interface (advance to bp/crash)
src/​tests/​SOS.TestHarness/​IDiagnosticHost.cs Host diagnostics capture interface
src/​tests/​SOS.TestHarness/​IDebuggerHost.cs Debugger host abstraction
src/​tests/​SOS.TestHarness/​HostSlot.cs Single-slot pooling/serialization for hosts
src/​tests/​SOS.TestHarness/​Hosts.cs Host axis enum
src/​tests/​SOS.TestHarness/​HostFactory.cs Host creation factory (dump/live)
src/​tests/​SOS.TestHarness/​HarnessSkip.cs Harness skip exception for xUnit v3 dynamic skips
src/​tests/​SOS.TestHarness/​HarnessCancellation.cs Bridge test cancellation into harness waits
src/​tests/​SOS.TestHarness/​GcType.cs GC axis enum
src/​tests/​SOS.TestHarness/​Flavor.cs Flavor axis enum
src/​tests/​SOS.TestHarness/​EngineProtocol.cs EngineHost REPL protocol markers
src/​tests/​SOS.TestHarness/​DumpKind.cs Dump kind axis enum
src/​tests/​SOS.TestHarness/​DumpGenerationRequirements.cs Windows reduced-dump prerequisite logic
src/​tests/​SOS.TestHarness/​DeadTarget.cs Dump-backed target cursor implementation
src/​tests/​SOS.TestHarness/​DbgEngDumpHost.cs In-proc dbgeng dump host
src/​tests/​SOS.TestHarness/​DbgEngCapturer.cs DbgEng-based dump capture for unsupported self-snapshot cases
src/​tests/​SOS.TestHarness/​DacPolicy.cs DAC selection policy + clamp env var
src/​tests/​SOS.TestHarness/​Dac.cs DAC axis enum
src/​tests/​SOS.TestHarness/​CoreVersion.cs Core version axis enum
src/​tests/​SOS.TestHarness/​CaptureCli.cs Capturer CLI entrypoint helper
src/​tests/​SOS.TestHarness.SourceGen/​SOS.TestHarness.SourceGen.csproj Source generator project definition
src/​tests/​SOS.TestHarness.EngineHost/​SOS.TestHarness.EngineHost.csproj EngineHost (dbgeng) child process project
src/​tests/​SOS.TestHarness.EngineHost/​Program.cs EngineHost REPL loop + run-to-* commands
src/​tests/​SOS.TestHarness.Capturer/​SOS.TestHarness.Capturer.csproj Capturer child process project
src/​tests/​SOS.TestHarness.Capturer/​Program.cs Capturer program entrypoint
src/​tests/​Debuggees.proj Debuggee build + single-file publish batch step

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/tests/Debuggees.proj
Comment thread src/tests/SOS.TestHarness/DumpGenerationRequirements.cs
Keep local build and test discovery enabled while the SOS.Tests execution moves to Helix in the upper stack layer.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c34cd9f4-d3b5-4b46-b7fc-e34b34bc88c3
Use the globally supplied official build identifier because ContinuousIntegrationBuild is false during the affected test invocation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c34cd9f4-d3b5-4b46-b7fc-e34b34bc88c3
Pass unprocessed MSBuild arguments through the final test build so OfficialBuildId and other globally supplied properties reach test project evaluation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c34cd9f4-d3b5-4b46-b7fc-e34b34bc88c3
Do not run the Unix apphost permission target when the temporary official-build SOS.Tests skip is active.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c34cd9f4-d3b5-4b46-b7fc-e34b34bc88c3
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c34cd9f4-d3b5-4b46-b7fc-e34b34bc88c3
@steveisok
steveisok merged commit 36ad68a into main Sep 4, 2026
26 checks passed
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.

4 participants