diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index af267de5c..eeb646ea1 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -69,9 +69,10 @@ jobs: azure-tests: runs-on: ubuntu-latest - if: | - github.event_name != 'pull_request' - || github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false + if: ${{ false }} + #if: | + # github.event_name != 'pull_request' + # || github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false steps: - uses: actions/checkout@v4 - name: Bootstrap Action Workspace diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 707285dcd..6a1bcee61 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -74,7 +74,7 @@ jobs: profiler-tests: runs-on: windows-2022 # Disable profiler tests for now - # if: ${{ false }} + if: ${{ false }} steps: - uses: actions/checkout@v4 - name: Bootstrap Action Workspace diff --git a/test/Elastic.Apm.Tests.Utilities/XUnit/DisabledTestFact.cs b/test/Elastic.Apm.Tests.Utilities/XUnit/DisabledTestFact.cs index 0b41a5508..a93c00de2 100644 --- a/test/Elastic.Apm.Tests.Utilities/XUnit/DisabledTestFact.cs +++ b/test/Elastic.Apm.Tests.Utilities/XUnit/DisabledTestFact.cs @@ -3,6 +3,7 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information +using System; using Xunit; namespace Elastic.Apm.Tests.Utilities.XUnit; @@ -16,3 +17,15 @@ public DisabledTestFact(string reason, string issueLink = null) Skip += $", issue link: {issueLink}"; } } + +public sealed class FlakyCiTestFact : FactAttribute +{ + public FlakyCiTestFact(int issueNumber) + { + if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("CI"))) + return; + + var issueLink = $"https://github.com/elastic/apm-agent-dotnet/issues/{issueNumber}"; + Skip = $"Flaky test on CI see: {issueLink}"; + } +} diff --git a/test/integrations/Elastic.Apm.AspNetCore.Tests/BaggageAspNetCoreTests.cs b/test/integrations/Elastic.Apm.AspNetCore.Tests/BaggageAspNetCoreTests.cs index 5ec9bc63d..be90d1a97 100644 --- a/test/integrations/Elastic.Apm.AspNetCore.Tests/BaggageAspNetCoreTests.cs +++ b/test/integrations/Elastic.Apm.AspNetCore.Tests/BaggageAspNetCoreTests.cs @@ -7,6 +7,7 @@ using System.Net.Http; using System.Threading.Tasks; using Elastic.Apm.Model; +using Elastic.Apm.Tests.Utilities.XUnit; using FluentAssertions; using Xunit; using Xunit.Abstractions; @@ -56,7 +57,7 @@ public async Task AccessBaggageFromUpstream() /// /// The test makes sure that the agent in the 2. service captures the baggage added by the 1. service. /// - [Fact] + [FlakyCiTestFact(2358)] public async Task MultipleServices() { var client = new HttpClient();