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

Fix 2.x smoke test and installer tests #5989

Closed
wants to merge 8 commits into from

Conversation

andrewlock
Copy link
Member

Summary of changes

  • Fix nuget/dd-trace installer tests in 2.x branch
  • Pin system tests in 2.x branch

Reason for change

The code we were using to install the "local" builds of the NuGet packages added the local source. However the dotnet restore was looking in both the local and nuget.org sources, and installing the highest version it found. That worked fine until we released 3.2.0 publicly and expect to install 2.59.0 of the local build.

For system-tests, we had to change how things work to support v3 (DataDog/system-tests#2962), but unfortunately that breaks for v2.

Implementation details

Explicitly create a new NuGet.config, disable the nuget.org source, and add our local source instead, install the tool/add the package, then remove the config.

For system tests, just pinning to the specific commit prior to the v3 PR being merged.

Test coverage

Running a full installer run here

Other details

Another way around this would be to explicitly set the version when we do the install. We should potentially do that in a follow up PR, but it would require a lot more effort, and it might be better to move the entire setup to Nuke if we're taking that approach

This PR also contains a backport of

@andrewlock andrewlock added area:builds project files, build scripts, pipelines, versioning, releases, packages area:tests unit tests, integration tests labels Sep 5, 2024
@andrewlock andrewlock requested a review from a team as a code owner September 5, 2024 12:17
@andrewlock andrewlock changed the title Fix 2.x build Fix 2.x smoke test and installer tests Sep 5, 2024
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Sep 5, 2024

Datadog Report

Branch report: andrew/ci/fix-installer-tests
Commit report: c9b729b
Test service: dd-trace-dotnet

✅ 0 Failed, 347277 Passed, 1803 Skipped, 14h 26m 36.88s Total Time

@andrewlock
Copy link
Member Author

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.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5989) - mean (74ms)  : 64, 84
     .   : milestone, 74,
    master - mean (69ms)  : 67, 71
     .   : milestone, 69,

    section CallTarget+Inlining+NGEN
    This PR (5989) - mean (1,036ms)  : 1016, 1056
     .   : milestone, 1036,
    master - mean (1,077ms)  : 1053, 1101
     .   : milestone, 1077,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5989) - mean (109ms)  : 105, 114
     .   : milestone, 109,
    master - mean (109ms)  : 105, 112
     .   : milestone, 109,

    section CallTarget+Inlining+NGEN
    This PR (5989) - mean (722ms)  : 698, 745
     .   : milestone, 722,
    master - mean (758ms)  : 739, 778
     .   : milestone, 758,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5989) - mean (93ms)  : 89, 96
     .   : milestone, 93,
    master - mean (92ms)  : 90, 95
     .   : milestone, 92,

    section CallTarget+Inlining+NGEN
    This PR (5989) - mean (673ms)  : 651, 696
     .   : milestone, 673,
    master - mean (710ms)  : 697, 724
     .   : milestone, 710,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5989) - mean (191ms)  : 188, 195
     .   : milestone, 191,
    master - mean (190ms)  : 187, 192
     .   : milestone, 190,

    section CallTarget+Inlining+NGEN
    This PR (5989) - mean (1,122ms)  : 1091, 1153
     .   : milestone, 1122,
    master - mean (1,160ms)  : 1137, 1184
     .   : milestone, 1160,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5989) - mean (276ms)  : 272, 279
     .   : milestone, 276,
    master - mean (274ms)  : 270, 279
     .   : milestone, 274,

    section CallTarget+Inlining+NGEN
    This PR (5989) - mean (886ms)  : 865, 908
     .   : milestone, 886,
    master - mean (922ms)  : 902, 942
     .   : milestone, 922,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5989) - mean (265ms)  : 261, 269
     .   : milestone, 265,
    master - mean (264ms)  : 259, 268
     .   : milestone, 264,

    section CallTarget+Inlining+NGEN
    This PR (5989) - mean (870ms)  : 848, 893
     .   : milestone, 870,
    master - mean (902ms)  : 883, 922
     .   : milestone, 902,

Loading

@andrewlock
Copy link
Member Author

Closed in favor of #5994

@andrewlock andrewlock closed this Sep 5, 2024
@andrewlock
Copy link
Member Author

Benchmarks Report for tracer 🐌

Benchmarks for #5989 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.185
  • All benchmarks have the same allocations

The following thresholds were used for comparing the benchmark speeds:

  • Mann–Whitney U test with statistical test for significance of 5%
  • Only results indicating a difference greater than 10% and 0.3 ns are considered.

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 7.62μs 41.6ns 246ns 0.0164 0.00818 0 5.43 KB
master StartStopWithChild netcoreapp3.1 9.69μs 53.4ns 311ns 0.0187 0.00935 0 5.62 KB
master StartStopWithChild net472 16.7μs 75.1ns 291ns 1.02 0.306 0.105 6.07 KB
#5989 StartStopWithChild net6.0 7.8μs 43ns 261ns 0.015 0.00751 0 5.43 KB
#5989 StartStopWithChild netcoreapp3.1 9.97μs 53.2ns 292ns 0.0149 0.00498 0 5.61 KB
#5989 StartStopWithChild net472 16.9μs 82.3ns 329ns 1.02 0.302 0.095 6.07 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 477μs 343ns 1.28μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 646μs 321ns 1.24μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 832μs 628ns 2.26μs 0.414 0 0 3.3 KB
#5989 WriteAndFlushEnrichedTraces net6.0 486μs 235ns 881ns 0 0 0 2.7 KB
#5989 WriteAndFlushEnrichedTraces netcoreapp3.1 647μs 388ns 1.45μs 0 0 0 2.7 KB
#5989 WriteAndFlushEnrichedTraces net472 847μs 648ns 2.42μs 0.422 0 0 3.3 KB
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 209μs 1.25μs 12.5μs 0.238 0 0 18.45 KB
master SendRequest netcoreapp3.1 229μs 1.32μs 10.1μs 0.25 0 0 20.61 KB
master SendRequest net472 0.00333ns 0.00128ns 0.00497ns 0 0 0 0 b
#5989 SendRequest net6.0 209μs 1.22μs 11.9μs 0.189 0 0 18.46 KB
#5989 SendRequest netcoreapp3.1 224μs 1.26μs 9.02μs 0.217 0 0 20.61 KB
#5989 SendRequest net472 0.000279ns 0.000199ns 0.000772ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 578μs 2.3μs 10.8μs 0.579 0 0 41.61 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 680μs 3.32μs 14.5μs 0.345 0 0 41.79 KB
master WriteAndFlushEnrichedTraces net472 878μs 4.14μs 16μs 8.39 2.52 0.419 53.31 KB
#5989 WriteAndFlushEnrichedTraces net6.0 594μs 3.19μs 22.7μs 0.571 0 0 41.67 KB
#5989 WriteAndFlushEnrichedTraces netcoreapp3.1 712μs 4.03μs 28.5μs 0.34 0 0 41.75 KB
#5989 WriteAndFlushEnrichedTraces net472 876μs 4.18μs 16.2μs 8.19 2.59 0.431 53.31 KB
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.26μs 1.46ns 5.66ns 0.0146 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.8μs 2.35ns 9.12ns 0.0135 0 0 1.02 KB
master ExecuteNonQuery net472 2.08μs 1.69ns 6.53ns 0.156 0 0 987 B
#5989 ExecuteNonQuery net6.0 1.29μs 1.46ns 5.66ns 0.0144 0 0 1.02 KB
#5989 ExecuteNonQuery netcoreapp3.1 1.65μs 1.71ns 6.6ns 0.0134 0 0 1.02 KB
#5989 ExecuteNonQuery net472 2.06μs 1.52ns 5.9ns 0.156 0 0 987 B
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.28μs 0.605ns 2.34ns 0.0134 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.5μs 0.945ns 3.53ns 0.0127 0 0 976 B
master CallElasticsearch net472 2.37μs 0.926ns 3.46ns 0.158 0 0 995 B
master CallElasticsearchAsync net6.0 1.2μs 0.697ns 2.7ns 0.0132 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.7μs 0.818ns 2.95ns 0.0136 0 0 1.02 KB
master CallElasticsearchAsync net472 2.56μs 2.01ns 7.79ns 0.167 0 0 1.05 KB
#5989 CallElasticsearch net6.0 1.27μs 0.858ns 3.32ns 0.0133 0 0 976 B
#5989 CallElasticsearch netcoreapp3.1 1.56μs 1.85ns 6.91ns 0.0133 0 0 976 B
#5989 CallElasticsearch net472 2.49μs 1.32ns 4.77ns 0.158 0 0 995 B
#5989 CallElasticsearchAsync net6.0 1.17μs 0.412ns 1.54ns 0.013 0 0 952 B
#5989 CallElasticsearchAsync netcoreapp3.1 1.65μs 1.27ns 4.74ns 0.0133 0 0 1.02 KB
#5989 CallElasticsearchAsync net472 2.52μs 7ns 26.2ns 0.166 0 0 1.05 KB
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.32μs 0.554ns 2.07ns 0.0133 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.69μs 0.858ns 3.21ns 0.0127 0 0 952 B
master ExecuteAsync net472 1.74μs 0.666ns 2.58ns 0.145 0 0 915 B
#5989 ExecuteAsync net6.0 1.27μs 0.504ns 1.89ns 0.0133 0 0 952 B
#5989 ExecuteAsync netcoreapp3.1 1.66μs 1.15ns 4.47ns 0.0124 0 0 952 B
#5989 ExecuteAsync net472 1.75μs 0.925ns 3.58ns 0.145 0 0 915 B
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net6.0 4.18μs 1.06ns 3.96ns 0.0315 0 0 2.22 KB
master SendAsync netcoreapp3.1 5.05μs 3.13ns 12.1ns 0.0377 0 0 2.76 KB
master SendAsync net472 7.71μs 3.63ns 13.6ns 0.497 0 0 3.15 KB
#5989 SendAsync net6.0 4.28μs 1.27ns 4.92ns 0.03 0 0 2.22 KB
#5989 SendAsync netcoreapp3.1 5.1μs 2.35ns 8.79ns 0.0357 0 0 2.76 KB
#5989 SendAsync net472 7.79μs 2.34ns 9.06ns 0.499 0 0 3.15 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 1.58μs 0.887ns 3.32ns 0.0229 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.24μs 1.11ns 4.17ns 0.0224 0 0 1.64 KB
master EnrichedLog net472 2.74μs 1.67ns 6.48ns 0.25 0 0 1.57 KB
#5989 EnrichedLog net6.0 1.47μs 0.804ns 3.11ns 0.0228 0 0 1.64 KB
#5989 EnrichedLog netcoreapp3.1 2.16μs 0.911ns 3.41ns 0.0228 0 0 1.64 KB
#5989 EnrichedLog net472 2.67μs 1.66ns 6.41ns 0.249 0 0 1.57 KB
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 117μs 159ns 616ns 0.058 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 121μs 273ns 1.06μs 0.0602 0 0 4.28 KB
master EnrichedLog net472 148μs 272ns 1.05μs 0.674 0.225 0 4.46 KB
#5989 EnrichedLog net6.0 116μs 158ns 613ns 0 0 0 4.28 KB
#5989 EnrichedLog netcoreapp3.1 119μs 238ns 921ns 0.0588 0 0 4.28 KB
#5989 EnrichedLog net472 151μs 219ns 850ns 0.675 0.225 0 4.46 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.95μs 0.788ns 2.95ns 0.0312 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.3μs 2.3ns 8.91ns 0.0302 0 0 2.2 KB
master EnrichedLog net472 4.79μs 1.61ns 6.25ns 0.32 0 0 2.02 KB
#5989 EnrichedLog net6.0 2.99μs 2.47ns 9.56ns 0.0313 0 0 2.2 KB
#5989 EnrichedLog netcoreapp3.1 4.13μs 0.717ns 2.78ns 0.0289 0 0 2.2 KB
#5989 EnrichedLog net472 4.87μs 2.76ns 10.7ns 0.32 0 0 2.02 KB
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 1.33μs 0.752ns 2.91ns 0.016 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.83μs 1.16ns 4.49ns 0.0156 0 0 1.14 KB
master SendReceive net472 2.21μs 1.7ns 6.58ns 0.183 0.00111 0 1.16 KB
#5989 SendReceive net6.0 1.32μs 0.696ns 2.7ns 0.0159 0 0 1.14 KB
#5989 SendReceive netcoreapp3.1 1.76μs 1.38ns 5.34ns 0.0152 0 0 1.14 KB
#5989 SendReceive net472 2.2μs 1.03ns 3.84ns 0.183 0.00109 0 1.16 KB
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.77μs 0.772ns 2.89ns 0.0222 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.97μs 1.17ns 4.21ns 0.0218 0 0 1.65 KB
master EnrichedLog net472 4.39μs 1.72ns 6.44ns 0.324 0 0 2.04 KB
#5989 EnrichedLog net6.0 2.76μs 1.13ns 4.36ns 0.022 0 0 1.6 KB
#5989 EnrichedLog netcoreapp3.1 3.91μs 2.91ns 11.3ns 0.0215 0 0 1.65 KB
#5989 EnrichedLog net472 4.54μs 5.66ns 21.9ns 0.324 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #5989

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 1.185 577.30 486.99

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 406ns 0.129ns 0.499ns 0.00798 0 0 576 B
master StartFinishSpan netcoreapp3.1 570ns 0.198ns 0.741ns 0.00788 0 0 576 B
master StartFinishSpan net472 663ns 2.62ns 9.8ns 0.0917 0 0 578 B
master StartFinishScope net6.0 577ns 0.385ns 1.49ns 0.00984 0 0 696 B
master StartFinishScope netcoreapp3.1 766ns 0.368ns 1.43ns 0.00957 0 0 696 B
master StartFinishScope net472 846ns 0.994ns 3.72ns 0.104 0 0 658 B
#5989 StartFinishSpan net6.0 417ns 0.136ns 0.528ns 0.00799 0 0 576 B
#5989 StartFinishSpan netcoreapp3.1 541ns 0.309ns 1.2ns 0.0078 0 0 576 B
#5989 StartFinishSpan net472 678ns 0.549ns 2.05ns 0.0916 0 0 578 B
#5989 StartFinishScope net6.0 487ns 0.234ns 0.906ns 0.00976 0 0 696 B
#5989 StartFinishScope netcoreapp3.1 763ns 0.519ns 2.01ns 0.00918 0 0 696 B
#5989 StartFinishScope net472 909ns 0.409ns 1.53ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 680ns 0.211ns 0.818ns 0.00964 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 965ns 0.47ns 1.76ns 0.00965 0 0 696 B
master RunOnMethodBegin net472 1.09μs 1.45ns 5.62ns 0.104 0 0 658 B
#5989 RunOnMethodBegin net6.0 709ns 0.472ns 1.83ns 0.00995 0 0 696 B
#5989 RunOnMethodBegin netcoreapp3.1 899ns 0.408ns 1.47ns 0.00969 0 0 696 B
#5989 RunOnMethodBegin net472 1.12μs 1.63ns 6.29ns 0.104 0 0 658 B

andrewlock added a commit that referenced this pull request Sep 6, 2024
## Summary of changes

- Fix nuget/dd-trace installer tests in 2.x branch
- Pin system tests in 2.x branch

## Reason for change

The code we were using to install the "local" builds of the NuGet
packages added the local source. However the dotnet restore was looking
in both the local and nuget.org sources, and installing the highest
version it found. That worked fine until we released 3.2.0 publicly and
expect to install 2.59.0 of the local build.

For system-tests, we had to change how things work to support v3
(DataDog/system-tests#2962), but unfortunately
that breaks for v2.

## Implementation details

Install an explicit version of the tracer. As this version is never in
the public nuget.org source but _is_ in the local source, it uses that.

> In #5989 I tried a
different approach but it just didn't work.

For system tests, just pinning to the specific commit prior to the v3 PR
being merged.

Having to thread the version through everywhere is kinda horrible, but
is the only thing I could find that works.

## Test coverage

Running [a full installer run
here](https://dev.azure.com/datadoghq/dd-trace-dotnet/_build/results?buildId=163526&view=results)

## Other details

The whole approach should be rewritten to be managed by Nuke tbh, if we
ever find time

This PR also contains a backport of 
- #5988
for simplicity

Supersedes
- #5989
andrewlock added a commit that referenced this pull request Sep 11, 2024
## Summary of changes

- Fix nuget/dd-trace installer tests in 2.x branch

## Reason for change

The code we were using to install the "local" builds of the NuGet
packages added the local source. However the dotnet restore was looking
in both the local and nuget.org sources, and installing the highest
version it found. That worked fine until we released 3.2.0 publicly and
expect to install 2.59.0 of the local build.

## Implementation details

Install an explicit version of the tracer. As this version is never in
the public nuget.org source but _is_ in the local source, it uses that.

> In #5989 I tried a
different approach but it just didn't work.

Having to thread the version through everywhere is kinda horrible, but
is the only thing I could find that works.

## Test coverage

Will run a [full installer
test](https://dev.azure.com/datadoghq/dd-trace-dotnet/_build/results?buildId=163706&view=results)

## Other details

The whole approach should be rewritten to be managed by Nuke tbh, if we
ever find time

This PR is a "forward port" of 
- #5994

(the issue was exhibited on the 2.x branch, so this is preemptive for
the future)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:builds project files, build scripts, pipelines, versioning, releases, packages area:tests unit tests, integration tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant