Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ private SampleProfile CaptureAndValidate(ITransactionProfilerFactory factory)
[SkippableFact]
public void Profiler_WithZeroStartupTimeout_CapturesAfterStartingAsynchronously()
{
if (TestEnvironment.IsGitHubActions)
{
Skip.If(TestEnvironment.IsWinX64, "Flaky in CI on Windows X64.");
Skip.If(RuntimeInformation.IsOSPlatform(OSPlatform.Linux), "Flaky in CI on Linux.");
}

using var factory = new SamplingTransactionProfilerFactory(_testSentryOptions, TimeSpan.Zero);
var profiler = factory.Start(new TransactionTracer(Substitute.For<IHub>(), "test", ""), CancellationToken.None);
Assert.Null(profiler);
Expand Down Expand Up @@ -146,6 +152,8 @@ private void Profiler_SingleProfile_Works(int startTimeoutSeconds)
[InlineData(10)]
public void Profiler_MultipleProfiles_Works(int startTimeoutSeconds)
{
Skip.If(TestEnvironment.IsGitHubActions, "Flaky in CI");

using var factory = new SamplingTransactionProfilerFactory(_testSentryOptions, TimeSpan.FromSeconds(startTimeoutSeconds));
// in the async startup case, we need to wait before collecting
if (startTimeoutSeconds == 0)
Expand Down
3 changes: 3 additions & 0 deletions test/Sentry.Testing/TestEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ public static bool IsGitHubActions
return isGitHubActions?.Equals("true", StringComparison.OrdinalIgnoreCase) == true;
}
}

public static bool IsWinX64 => RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
&& RuntimeInformation.OSArchitecture == Architecture.X64;
}
Loading