From a5473a33dae136918ca45152af8fd97f86cfe138 Mon Sep 17 00:00:00 2001 From: el kampu <11272320+elkampu@users.noreply.github.com> Date: Fri, 4 Sep 2026 15:45:14 +0200 Subject: [PATCH] test: serialize profiling test classes Co-Authored-By: OpenAI Codex --- .../ProfilingSentryOptionsExtensionsTests.cs | 1 + test/Sentry.Profiling.Tests/ProfilingTestCollection.cs | 6 ++++++ .../SamplingTransactionProfilerTests.cs | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 test/Sentry.Profiling.Tests/ProfilingTestCollection.cs diff --git a/test/Sentry.Profiling.Tests/ProfilingSentryOptionsExtensionsTests.cs b/test/Sentry.Profiling.Tests/ProfilingSentryOptionsExtensionsTests.cs index 3ba7bf3cf6..226e7f5e20 100644 --- a/test/Sentry.Profiling.Tests/ProfilingSentryOptionsExtensionsTests.cs +++ b/test/Sentry.Profiling.Tests/ProfilingSentryOptionsExtensionsTests.cs @@ -2,6 +2,7 @@ namespace Sentry.Profiling.Tests; #nullable enable +[Collection(nameof(ProfilingTestCollection))] public class ProfilingSentryOptionsExtensionsTests { private readonly InMemoryDiagnosticLogger _logger = new(); diff --git a/test/Sentry.Profiling.Tests/ProfilingTestCollection.cs b/test/Sentry.Profiling.Tests/ProfilingTestCollection.cs new file mode 100644 index 0000000000..8c7fdceeb2 --- /dev/null +++ b/test/Sentry.Profiling.Tests/ProfilingTestCollection.cs @@ -0,0 +1,6 @@ +namespace Sentry.Profiling.Tests; + +[CollectionDefinition(nameof(ProfilingTestCollection), DisableParallelization = true)] +public sealed class ProfilingTestCollection +{ +} diff --git a/test/Sentry.Profiling.Tests/SamplingTransactionProfilerTests.cs b/test/Sentry.Profiling.Tests/SamplingTransactionProfilerTests.cs index 1ba4e4f372..25e1841d3e 100644 --- a/test/Sentry.Profiling.Tests/SamplingTransactionProfilerTests.cs +++ b/test/Sentry.Profiling.Tests/SamplingTransactionProfilerTests.cs @@ -6,7 +6,7 @@ namespace Sentry.Profiling.Tests; // Note: we must not run tests in parallel because we only support profiling one transaction at a time. // That means setting up a test-collection with parallelization disabled and NOT using any async test functions. -[CollectionDefinition(nameof(SamplingTransactionProfilerTests), DisableParallelization = true)] +[Collection(nameof(ProfilingTestCollection))] public class SamplingTransactionProfilerTests { private readonly TestOutputDiagnosticLogger _testOutputLogger;