Skip to content

Profiling tests never actually opt out of parallel execution #5524

Closed

Description

@jamescrosswell

SamplingTransactionProfilerTests intends to opt out of parallel execution, but the attribute it uses only defines a collection — it never joins one:

// test/Sentry.Profiling.Tests/SamplingTransactionProfilerTests.cs
[CollectionDefinition(nameof(SamplingTransactionProfilerTests), DisableParallelization = true)]
public class SamplingTransactionProfilerTests

A class joins a collection with [Collection(name)], which is absent here, so
DisableParallelization never takes effect. The file's own comment describes an intent that isn't
implemented.

Why

test/xunit.runner.json and test/xunit.runner.windows.json both set parallelizeTestCollections: false and maxParallelThreads: 1, and test/Directory.Build.targets copies one of them into every test project's output — so collections in this assembly have never run in parallel, on any OS. So this never caused flaky profiling tests.

However the guard would otherwise remain absent if the // TODO: Re-enable parallelization in the runner json is ever acted
on.

Activity

  1. linear-code commented on Aug 31, 2026

    @linear-code
  2. added
    .NET
    on Aug 31, 2026
  3. elkampu commented on Sep 4, 2026

    @elkampu
    Contributor

    I have reproduced the collection configuration issue and am preparing a focused fix: define a dedicated non-parallel profiling collection and make both profiler-related test classes join it. The complete net10.0 profiling test project passes locally (27 passed, 3 intentionally skipped).

  4. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETGood First IssueProfilesTests

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions