Skip to content

[cDAC] Switch runtime-diagnostics SOS test filter to -method for wildcard support#127878

Merged
max-charlamb merged 1 commit intodotnet:mainfrom
max-charlamb:fix/diag-pipeline-sos-method-filter
May 6, 2026
Merged

[cDAC] Switch runtime-diagnostics SOS test filter to -method for wildcard support#127878
max-charlamb merged 1 commit intodotnet:mainfrom
max-charlamb:fix/diag-pipeline-sos-method-filter

Conversation

@max-charlamb
Copy link
Copy Markdown
Member

Note

This PR was created with the assistance of GitHub Copilot (AI-generated content).

Problem

dotnet/diagnostics PR #5821 split the single SOS test class into 11 SOS-prefixed classes (SOSStackTraceTests, SOSExceptionTests, SOSGCTests, SOSDumpTests, etc.) to enable parallelism. The existing classFilter: SOS in runtime-diagnostics.yml no longer matches any class, so the cDAC, cDAC_no_fallback, and DAC test legs are now silently running zero tests.

A naïve fix to classFilter: SOS* does not work either: xunit v2's -class filter is a HashSet<string> with exact-match Contains() only; it has no wildcard support. I verified this by directly invoking XunitFilters.Filter() against xunit.runner.utility 2.9.2:

Filter Matches SOSStackTraceTests.TestMethod1
-class SOS* ❌ No (literal HashSet contains)
-method SOS* Yes
Multiple -class entries ✅ Yes (would require enumerating all 11)

Fix

xunit v2's -method filter is regex-based and operates on the fully qualified ClassName.MethodName, so SOS* matches every method on any SOS-prefixed class.

This PR:

  1. Adds a methodFilter parameter to eng/pipelines/diagnostics/runtime-diag-job.yml (parallel to the existing classFilter), wiring it through to the diagnostics build.ps1's already-supported -methodfilter argument.
  2. Switches the three SOS test legs in eng/pipelines/runtime-diagnostics.yml (cDAC, cDAC_no_fallback, DAC) to methodFilter: SOS*.

The existing classFilter parameter is left in place for any other consumer that needs exact-match class filtering.

dotnet/diagnostics PR dotnet#5821 split the single `SOS` test class into 11
SOS-prefixed classes (`SOSStackTraceTests`, `SOSExceptionTests`, etc.)
to enable parallelism. The existing `classFilter: SOS` no longer matches
any class, so the cDAC, cDAC_no_fallback, and DAC test legs were silently
running zero tests.

xunit v2's `-class` filter is a HashSet exact-match (no wildcards), so
`SOS*` will not work either -- this was verified by directly invoking
`XunitFilters.Filter()` against xunit.runner.utility 2.9.2.

xunit v2's `-method` filter, however, IS regex-based and matches against
the fully qualified `ClassName.MethodName`. `SOS*` matches all methods
on the new SOS* classes.

Add a `methodFilter` parameter to `runtime-diag-job.yml` (parallel to
the existing `classFilter`) and switch the three SOS test legs in
`runtime-diagnostics.yml` to `methodFilter: SOS*`.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

@max-charlamb max-charlamb requested a review from hoyosjs May 6, 2026 17:53
@max-charlamb
Copy link
Copy Markdown
Member Author

/ba-g cDAC pipeline only change

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants