Skip to content

Conversation

@bouwkast
Copy link
Collaborator

Summary of changes

Skip failing TraceAnnotationsTests in .NET 6.0

Reason for change

Started failing after #7287

Implementation details

Just a dumb Skip.If to skip for the time if we are in .NET 6.0

Test coverage

Other details

@bouwkast bouwkast requested review from a team as code owners September 23, 2025 16:42
@github-actions github-actions bot added the area:tests unit tests, integration tests label Sep 23, 2025
Copy link
Member

@andrewlock andrewlock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@bouwkast bouwkast enabled auto-merge (squash) September 23, 2025 16:49
@dd-trace-dotnet-ci-bot
Copy link

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing the following branches/commits:

Execution-time benchmarks measure the whole time it takes to execute a program. And are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are shown in red. The following thresholds were used for comparing the execution times:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard.

Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph).

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7551) - mean (73ms)  : 72, 75
     .   : milestone, 73,
    master - mean (73ms)  : 71, 76
     .   : milestone, 73,

    section Baseline
    This PR (7551) - mean (69ms)  : 67, 71
     .   : milestone, 69,
    master - mean (70ms)  : 65, 76
     .   : milestone, 70,

    section CallTarget+Inlining+NGEN
    This PR (7551) - mean (1,062ms)  : 1007, 1117
     .   : milestone, 1062,
    master - mean (1,059ms)  : 1003, 1114
     .   : milestone, 1059,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7551) - mean (110ms)  : 107, 112
     .   : milestone, 110,
    master - mean (109ms)  : 106, 111
     .   : milestone, 109,

    section Baseline
    This PR (7551) - mean (107ms)  : 105, 110
     .   : milestone, 107,
    master - mean (108ms)  : 106, 111
     .   : milestone, 108,

    section CallTarget+Inlining+NGEN
    This PR (7551) - mean (748ms)  : 723, 772
     .   : milestone, 748,
    master - mean (751ms)  : 723, 779
     .   : milestone, 751,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7551) - mean (97ms)  : 93, 101
     .   : milestone, 97,
    master - mean (97ms)  : 94, 99
     .   : milestone, 97,

    section Baseline
    This PR (7551) - mean (95ms)  : 92, 99
     .   : milestone, 95,
    master - mean (95ms)  : 93, 97
     .   : milestone, 95,

    section CallTarget+Inlining+NGEN
    This PR (7551) - mean (715ms)  : 690, 740
     .   : milestone, 715,
    master - mean (713ms)  : 693, 734
     .   : milestone, 713,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7551) - mean (98ms)  : 95, 100
     .   : milestone, 98,
    master - mean (95ms)  : 93, 96
     .   : milestone, 95,

    section Baseline
    This PR (7551) - mean (94ms)  : 91, 97
     .   : milestone, 94,
    master - mean (94ms)  : 92, 96
     .   : milestone, 94,

    section CallTarget+Inlining+NGEN
    This PR (7551) - mean (667ms)  : 651, 684
     .   : milestone, 667,
    master - mean (672ms)  : 654, 691
     .   : milestone, 672,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7551) - mean (203ms)  : 200, 207
     .   : milestone, 203,
    master - mean (198ms)  : 196, 201
     .   : milestone, 198,

    section Baseline
    This PR (7551) - mean (200ms)  : 196, 204
     .   : milestone, 200,
    master - mean (195ms)  : 191, 199
     .   : milestone, 195,

    section CallTarget+Inlining+NGEN
    This PR (7551) - mean (1,194ms)  : 1133, 1255
     .   : milestone, 1194,
    master - mean (1,170ms)  : 1115, 1225
     .   : milestone, 1170,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7551) - mean (287ms)  : 282, 293
     .   : milestone, 287,
    master - mean (282ms)  : 274, 291
     .   : milestone, 282,

    section Baseline
    This PR (7551) - mean (288ms)  : 281, 294
     .   : milestone, 288,
    master - mean (283ms)  : 276, 289
     .   : milestone, 283,

    section CallTarget+Inlining+NGEN
    This PR (7551) - mean (958ms)  : 918, 998
     .   : milestone, 958,
    master - mean (949ms)  : 908, 990
     .   : milestone, 949,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7551) - mean (281ms)  : 277, 286
     .   : milestone, 281,
    master - mean (273ms)  : 269, 276
     .   : milestone, 273,

    section Baseline
    This PR (7551) - mean (281ms)  : 276, 287
     .   : milestone, 281,
    master - mean (273ms)  : 266, 281
     .   : milestone, 273,

    section CallTarget+Inlining+NGEN
    This PR (7551) - mean (948ms)  : 905, 991
     .   : milestone, 948,
    master - mean (927ms)  : 889, 965
     .   : milestone, 927,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7551) - mean (280ms)  : 275, 285
     .   : milestone, 280,
    master - mean (271ms)  : 267, 275
     .   : milestone, 271,

    section Baseline
    This PR (7551) - mean (280ms)  : 274, 287
     .   : milestone, 280,
    master - mean (271ms)  : 265, 278
     .   : milestone, 271,

    section CallTarget+Inlining+NGEN
    This PR (7551) - mean (877ms)  : 849, 905
     .   : milestone, 877,
    master - mean (862ms)  : 839, 885
     .   : milestone, 862,

Loading

@bouwkast bouwkast merged commit 9d1a4cb into master Sep 23, 2025
69 of 72 checks passed
@bouwkast bouwkast deleted the steven/skip-annotation-test branch September 23, 2025 18:51
@github-actions github-actions bot added this to the vNext-v3 milestone Sep 23, 2025
bouwkast added a commit that referenced this pull request Sep 23, 2025
## Summary of changes

Skip failing TraceAnnotationsTests in .NET 6.0

## Reason for change

Started failing after
#7287

## Implementation details

Just a dumb Skip.If to skip for the time if we are in .NET 6.0

## Test coverage

~~I missed this one in
#7551 😢~~

I did the wrong one in
#7551 after looking at
the logs again

## Other details
<!-- Fixes #{issue} -->


<!--  ⚠️ Note:

Where possible, please obtain 2 approvals prior to merging. Unless
CODEOWNERS specifies otherwise, for external teams it is typically best
to have one review from a team member, and one review from apm-dotnet.
Trivial changes do not require 2 reviews.

MergeQueue is NOT enabled in this repository. If you have write access
to the repo, the PR has 1-2 approvals (see above), and all of the
required checks have passed, you can use the Squash and Merge button to
merge the PR. If you don't have write access, or you need help, reach
out in the #apm-dotnet channel in Slack.
-->
andrewlock added a commit that referenced this pull request Sep 24, 2025
## Summary of changes

Fixes flakiness in the `TraceAnnotation` tests

## Reason for change

#7287 incidentally
introduced flakiness in the test when the profiler is not available
(i.e. only on Windows). We temporarily disabled the test in #7551 and
#7552. This reinstates the test, and removes the flake.

## Implementation details

The important thing is that we do a "real" instrumentation in the app,
to insure that we send instrumentation telemetry. Without this, there's
a race condition between us instrumenting our "own" `HttpClient` usages
and the app ending.

In more detail, we see this flake because:

- The integration telemetry is only sent when something is instrumented
(or subsequently errors)
- The delay in profiling introduced in #7287 causes a delay in sending
the calltarget definitions
  - We will address that delay in a separate PR
- The telemetry thread runs in the background, and is already started
before we P/Invoke into the profiler
- The delay causes us to not instrument the HttpClient calls that the
background telemetry thread makes initially - if we skip the P/Invoke,
then they are instrumented at this point
- The app shuts down, which causes another telemetry flush
- At this point the `HttpClient` calls are instrumented, and the
instrumentation details are collected, but now we're shutting down, so
this data is never sent.

By forcing an instrumentation in the app, we bypass the race condition
entirely.

## Test coverage

Excluded the span from the tests so it's effectively the same. We don't
care about the contents of that span (or whether the request passes or
fails) - we just want to make sure we have instrumentation.

## Other details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:tests unit tests, integration tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants