Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

action: test windows core (build and startup hooks) #1996

Merged
merged 8 commits into from
May 23, 2023

Conversation

v1v
Copy link
Member

@v1v v1v commented Jan 27, 2023

What

Migrate Windows Core stage to GitHub actions using Windows Latest runners

Further details

windows-2019 runners don't have the required tools:

Version 7.0.100 of the .NET SDK requires at least version 17.3.0 of MSBuild. The current available version of MSBuild is 16.11.2.50704. Change the .NET SDK specified in global.json to an older version that requires the MSBuild version currently available.

Hence builds are failing

Task

  • Test stage
  • Profiler

Issues

Originally implemented in #1989

@v1v v1v added automation Team:Automation Label for the Observability productivity team labels Jan 27, 2023
@v1v v1v self-assigned this Jan 27, 2023
@elastic-apm-tech elastic-apm-tech added this to In Progress in APM-Agents (OLD) Jan 27, 2023
@apmmachine
Copy link
Collaborator

apmmachine commented Jan 27, 2023

💔 Tests Failed

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-01-27T11:46:45.434+0000

  • Duration: 115 min 41 sec

Test stats 🧪

Test Results
Failed 3
Passed 22087
Skipped 165
Total 22255

Test errors 3

Expand to view the tests failures

Initializing / Parallel / Linux / Test / DistributedTracingAspNetCoreTests.Elastic.Apm.AspNetCore.Tests.DistributedTracingAspNetCoreTests.NonSampledDistributedTraceAcross2Service – Elastic.Apm.AspNetCore.Tests.DistributedTracingAspNetCoreTests
    Expand to view the error details

     System.Threading.Tasks.TaskCanceledException : The operation was canceled.
    ---- System.IO.IOException : Unable to read data from the transport connection: Operation canceled.
    -------- System.Net.Sockets.SocketException : Operation canceled 
    

    Expand to view the stacktrace

     System.Threading.Tasks.TaskCanceledException : The operation was canceled.
    ---- System.IO.IOException : Unable to read data from the transport connection: Operation canceled.
    -------- System.Net.Sockets.SocketException : Operation canceled
    Stack Trace:
       at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
       at System.Net.Http.HttpConnectionPool.SendWithNtConnectionAuthAsync(HttpConnection connection, HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
       at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
       at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
       at System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
       at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
       at Elastic.Apm.AspNetCore.Tests.DistributedTracingAspNetCoreTests.ExecuteAndCheckDistributedCall(Boolean startActivityBeforeHttpCall) in /var/lib/jenkins/workspace/net_apm-agent-dotnet-mbp_PR-1996/apm-agent-dotnet/test/Elastic.Apm.AspNetCore.Tests/DistributedTracingAspNetCoreTests.cs:line 527
       at Elastic.Apm.AspNetCore.Tests.DistributedTracingAspNetCoreTests.NonSampledDistributedTraceAcross2Service() in /var/lib/jenkins/workspace/net_apm-agent-dotnet-mbp_PR-1996/apm-agent-dotnet/test/Elastic.Apm.AspNetCore.Tests/DistributedTracingAspNetCoreTests.cs:line 154
    --- End of stack trace from previous location where exception was thrown ---
    ----- Inner Stack Trace -----
       at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
       at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token)
       at System.Net.Http.HttpConnection.FillAsync()
       at System.Net.Http.HttpConnection.ReadNextResponseHeaderLineAsync(Boolean foldedHeadersAllowed)
       at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
    ----- Inner Stack Trace ----- 
    

Initializing / Parallel / Linux / Test / DistributedTracingAspNetCoreTests.Elastic.Apm.AspNetCore.Tests.DistributedTracingAspNetCoreTests.DistributedTraceAcross2Service – Elastic.Apm.AspNetCore.Tests.DistributedTracingAspNetCoreTests
    Expand to view the error details

     System.Threading.Tasks.TaskCanceledException : The operation was canceled.
    ---- System.IO.IOException : Unable to read data from the transport connection: Operation canceled.
    -------- System.Net.Sockets.SocketException : Operation canceled 
    

    Expand to view the stacktrace

     System.Threading.Tasks.TaskCanceledException : The operation was canceled.
    ---- System.IO.IOException : Unable to read data from the transport connection: Operation canceled.
    -------- System.Net.Sockets.SocketException : Operation canceled
    Stack Trace:
       at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
       at System.Net.Http.HttpConnectionPool.SendWithNtConnectionAuthAsync(HttpConnection connection, HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
       at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
       at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
       at System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
       at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
       at Elastic.Apm.AspNetCore.Tests.DistributedTracingAspNetCoreTests.ExecuteAndCheckDistributedCall(Boolean startActivityBeforeHttpCall) in /var/lib/jenkins/workspace/net_apm-agent-dotnet-mbp_PR-1996/apm-agent-dotnet/test/Elastic.Apm.AspNetCore.Tests/DistributedTracingAspNetCoreTests.cs:line 527
       at Elastic.Apm.AspNetCore.Tests.DistributedTracingAspNetCoreTests.DistributedTraceAcross2Service() in /var/lib/jenkins/workspace/net_apm-agent-dotnet-mbp_PR-1996/apm-agent-dotnet/test/Elastic.Apm.AspNetCore.Tests/DistributedTracingAspNetCoreTests.cs:line 98
    --- End of stack trace from previous location where exception was thrown ---
    ----- Inner Stack Trace -----
       at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
       at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token)
       at System.Net.Http.HttpConnection.FillAsync()
       at System.Net.Http.HttpConnection.ReadNextResponseHeaderLineAsync(Boolean foldedHeadersAllowed)
       at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
    ----- Inner Stack Trace ----- 
    

Initializing / Parallel / Linux / Test / ConstructorTests.Elastic.Apm.Tests.ConstructorTests.Ctor_MustHonor_AgentFeatures_WhenSettingUp_MetricsCollectorAndCentralConfig – Elastic.Apm.Tests.ConstructorTests
    Expand to view the error details

     Expected agentComponents.MetricsCollector to be <null>, but found 
    
    Elastic.Apm.Metrics.MetricsCollector
    {
       MetricsProviders = {Elastic.Apm.Metrics.MetricsProvider.BreakdownMetricsProvider
          {
             ConsecutiveNumberOfFailedReads = 0
             DbgName = "BreakdownMetricsProvider"
             IsMetricAlreadyCaptured = False
          }, Elastic.Apm.Metrics.MetricsProvider.ProcessTotalCpuTimeProvider
          {
             ConsecutiveNumberOfFailedReads = 0
             DbgName = "process total CPU time"
             IsMetricAlreadyCaptured = True
          }, Elastic.Apm.Metrics.MetricsProvider.SystemTotalCpuProvider
          {
             ConsecutiveNumberOfFailedReads = 0
             DbgName = "total system CPU time"
             IsMetricAlreadyCaptured = True
          }, Elastic.Apm.Metrics.MetricsProvider.ProcessWorkingSetAndVirtualMemoryProvider
          {
             ConsecutiveNumberOfFailedReads = 0
             DbgName = "process's working set and virtual memory size"
             IsMetricAlreadyCaptured = True
          }, Elastic.Apm.Metrics.MetricsProvider.FreeAndTotalMemoryProvider
          {
             ConsecutiveNumberOfFailedReads = 0
             DbgName = "total and free memory"
             IsMetricAlreadyCaptured = True
          }, Elastic.Apm.Metrics.MetricsProvider.GcMetricsProvider
          {
             ConsecutiveNumberOfFailedReads = 0
             DbgName = "GcMetricsProvider"
             IsMetricAlreadyCaptured = False
             TraceEventSessionName = <null>
          }, Elastic.Apm.Metrics.MetricsProvider.CgroupMetricsProvider
          {
             ConsecutiveNumberOfFailedReads = 0
             DbgName = "CgroupMetricsProvider"
             IsMetricAlreadyCaptured = True
          }}
    }. 
    

    Expand to view the stacktrace

     Expected agentComponents.MetricsCollector to be <null>, but found 
    
    Elastic.Apm.Metrics.MetricsCollector
    {
       MetricsProviders = {Elastic.Apm.Metrics.MetricsProvider.BreakdownMetricsProvider
          {
             ConsecutiveNumberOfFailedReads = 0
             DbgName = "BreakdownMetricsProvider"
             IsMetricAlreadyCaptured = False
          }, Elastic.Apm.Metrics.MetricsProvider.ProcessTotalCpuTimeProvider
          {
             ConsecutiveNumberOfFailedReads = 0
             DbgName = "process total CPU time"
             IsMetricAlreadyCaptured = True
          }, Elastic.Apm.Metrics.MetricsProvider.SystemTotalCpuProvider
          {
             ConsecutiveNumberOfFailedReads = 0
             DbgName = "total system CPU time"
             IsMetricAlreadyCaptured = True
          }, Elastic.Apm.Metrics.MetricsProvider.ProcessWorkingSetAndVirtualMemoryProvider
          {
             ConsecutiveNumberOfFailedReads = 0
             DbgName = "process's working set and virtual memory size"
             IsMetricAlreadyCaptured = True
          }, Elastic.Apm.Metrics.MetricsProvider.FreeAndTotalMemoryProvider
          {
             ConsecutiveNumberOfFailedReads = 0
             DbgName = "total and free memory"
             IsMetricAlreadyCaptured = True
          }, Elastic.Apm.Metrics.MetricsProvider.GcMetricsProvider
          {
             ConsecutiveNumberOfFailedReads = 0
             DbgName = "GcMetricsProvider"
             IsMetricAlreadyCaptured = False
             TraceEventSessionName = <null>
          }, Elastic.Apm.Metrics.MetricsProvider.CgroupMetricsProvider
          {
             ConsecutiveNumberOfFailedReads = 0
             DbgName = "CgroupMetricsProvider"
             IsMetricAlreadyCaptured = True
          }}
    }.
    Stack Trace:
       at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message)
       at FluentAssertions.Execution.TestFrameworkProvider.Throw(String message)
       at FluentAssertions.Execution.DefaultAssertionStrategy.HandleFailure(String message)
       at FluentAssertions.Execution.AssertionScope.FailWith(Func`1 failReasonFunc)
       at FluentAssertions.Execution.AssertionScope.FailWith(String message, Object[] args)
       at FluentAssertions.Primitives.ReferenceTypeAssertions`2.BeNull(String because, Object[] becauseArgs)
       at Elastic.Apm.Tests.ConstructorTests.Ctor_MustHonor_AgentFeatures_WhenSettingUp_MetricsCollectorAndCentralConfig() in /var/lib/jenkins/workspace/net_apm-agent-dotnet-mbp_PR-1996/apm-agent-dotnet/test/Elastic.Apm.Tests/ConstructorTests.cs:line 57 
    

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run benchmark tests : Run the benchmark test.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

.github/workflows/test-windows-core.yml Outdated Show resolved Hide resolved
.github/workflows/test-windows-core.yml Outdated Show resolved Hide resolved
@v1v
Copy link
Member Author

v1v commented Jan 27, 2023

@elastic/apm-agent-net , I'm getting some errors when running the profiler testing regarding the docker containers:

[testcontainers.org 00:00:22.45] Docker registry credential mcr.microsoft.com not found
[testcontainers.org 00:00:22.93] Docker image mcr.microsoft.com/mssql/server:2017-CU28-ubuntu-16.04 created
[xUnit.net 00:00:40.29]     Elastic.Apm.Profiler.Managed.Tests.AdoNet.SqlCommandTests.CaptureAutoInstrumentedSpans(targetFramework: "net6.0") [FAIL]
[xUnit.net 00:00:40.30]     Elastic.Apm.Profiler.Managed.Tests.AdoNet.SqlCommandTests.CaptureAutoInstrumentedSpans(targetFramework: "net5.0") [FAIL]
[xUnit.net 00:00:40.30]     Elastic.Apm.Profiler.Managed.Tests.AdoNet.SqlCommandTests.CaptureAutoInstrumentedSpans(targetFramework: "net7.0") [FAIL]
[xUnit.net 00:00:40.30]     Elastic.Apm.Profiler.Managed.Tests.AdoNet.SqlCommandTests.CaptureAutoInstrumentedSpans(targetFramework: "netcoreapp3.1") [FAIL]
[testcontainers.org 00:00:23.26] Docker image postgres:11.14 created
[xUnit.net 00:00:40.58]     Elastic.Apm.Profiler.Managed.Tests.AdoNet.NpgSqlCommandTests.CaptureAutoInstrumentedSpans(targetFramework: "net461", npgsqlVersion: "5.0.7") [FAIL]
  Failed Elastic.Apm.Profiler.Managed.Tests.AdoNet.SqlCommandTests.CaptureAutoInstrumentedSpans(targetFramework: "net6.0") [1 ms]
[xUnit.net 00:00:40.58]     Elastic.Apm.Profiler.Managed.Tests.AdoNet.NpgSqlCommandTests.CaptureAutoInstrumentedSpans(targetFramework: "netcoreapp3.1", npgsqlVersion: "6.0.2") [FAIL]
  Error Message:
[xUnit.net 00:00:40.58]     Elastic.Apm.Profiler.Managed.Tests.AdoNet.NpgSqlCommandTests.CaptureAutoInstrumentedSpans(targetFramework: "netcoreapp3.1", npgsqlVersion: "5.0.7") [FAIL]
   Docker.DotNet.DockerImageNotFoundException : Docker API responded with status code=NotFound, response={"message":"No such image: mcr.microsoft.com/mssql/server:2017-CU28-ubuntu-16.04"}
[xUnit.net 00:00:40.58]     Elastic.Apm.Profiler.Managed.Tests.AdoNet.NpgSqlCommandTests.CaptureAutoInstrumentedSpans(targetFramework: "net5.0", npgsqlVersion: "5.0.7") [FAIL]

  Stack Trace:
     at Docker.DotNet.ContainerOperations.<>c.<.cctor>b__30_1(HttpStatusCode statusCode, String responseBody)
   at Docker.DotNet.DockerClient.HandleIfErrorResponseAsync(HttpStatusCode statusCode, HttpResponseMessage response, IEnumerable`1 handlers)
   at Docker.DotNet.DockerClient.MakeRequestAsync(IEnumerable`1 errorHandlers, HttpMethod method, String path, IQueryString queryString, IRequestContent body, IDictionary`2 headers, TimeSpan timeout, CancellationToken token)
   at Docker.DotNet.ContainerOperations.CreateContainerAsync(CreateContainerParameters parameters, CancellationToken cancellationToken)
   at DotNet.Testcontainers.Clients.DockerContainerOperations.RunAsync(ITestcontainersConfiguration configuration, CancellationToken ct)
   at DotNet.Testcontainers.Clients.TestcontainersClient.RunAsync(ITestcontainersConfiguration configuration, CancellationToken ct)
   at DotNet.Testcontainers.Containers.TestcontainersContainer.Create(CancellationToken ct)
   at DotNet.Testcontainers.Containers.TestcontainersContainer.StartAsync(CancellationToken ct)
   at DotNet.Testcontainers.Containers.MsSqlTestcontainer.StartAsync(CancellationToken ct)
   at Elastic.Apm.Profiler.Managed.Tests.AdoNet.SqlServerFixture.InitializeAsync() in D:\a\apm-agent-dotnet\apm-agent-dotnet\test\Elastic.Apm.Profiler.Managed.Tests\AdoNet\SqlServerFixture.cs:line 38
  Failed Elastic.Apm.Profiler.Managed.Tests.AdoNet.SqlCommandTests.CaptureAutoInstrumentedSpans(targetFramework: "net5.0") [1 ms]
  Error Message:
   Docker.DotNet.DockerImageNotFoundException : Docker API responded with status code=NotFound, response={"message":"No such image: mcr.microsoft.com/mssql/server:2017-CU28-ubuntu-16.04"}

Logs can be found in https://github.com/elastic/apm-agent-dotnet/actions/runs/4024168208/jobs/6915883942#step:8:1015

Any hints what's the error about?

@v1v
Copy link
Member Author

v1v commented May 22, 2023

@Mpdreamz , @amannocci is leading this migration, I defer to him to decide how to proceed 🙏

@Mpdreamz Mpdreamz marked this pull request as ready for review May 23, 2023 08:05
@Mpdreamz
Copy link
Member

Both failures unrelated:

  • Build MSBUILD is broken due to nuget
  • test-linux / profiler-test seems intermittent, succeeded before on this PR. Something to look into separately.

@Mpdreamz Mpdreamz merged commit 8206f03 into main May 23, 2023
5 of 6 checks passed
APM-Agents (OLD) automation moved this from In Progress to Done May 23, 2023
@Mpdreamz Mpdreamz deleted the feature/test-windows-core branch May 23, 2023 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-dotnet automation Team:Automation Label for the Observability productivity team
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants