-
Notifications
You must be signed in to change notification settings - Fork 147
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
Reduce flake in Fleet installer tests #6671
Conversation
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:
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 (6671) - mean (69ms) : 66, 71
. : milestone, 69,
master - mean (69ms) : 66, 71
. : milestone, 69,
section CallTarget+Inlining+NGEN
This PR (6671) - mean (999ms) : 975, 1023
. : milestone, 999,
master - mean (996ms) : 972, 1019
. : milestone, 996,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6671) - mean (102ms) : 100, 104
. : milestone, 102,
master - mean (101ms) : 99, 103
. : milestone, 101,
section CallTarget+Inlining+NGEN
This PR (6671) - mean (675ms) : 659, 692
. : milestone, 675,
master - mean (675ms) : 660, 691
. : milestone, 675,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6671) - mean (89ms) : 87, 91
. : milestone, 89,
master - mean (89ms) : 87, 91
. : milestone, 89,
section CallTarget+Inlining+NGEN
This PR (6671) - mean (627ms) : 613, 640
. : milestone, 627,
master - mean (634ms) : 614, 654
. : milestone, 634,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6671) - mean (191ms) : 187, 196
. : milestone, 191,
master - mean (191ms) : 187, 195
. : milestone, 191,
section CallTarget+Inlining+NGEN
This PR (6671) - mean (1,109ms) : 1086, 1133
. : milestone, 1109,
master - mean (1,113ms) : 1085, 1140
. : milestone, 1113,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6671) - mean (271ms) : 268, 275
. : milestone, 271,
master - mean (271ms) : 266, 276
. : milestone, 271,
section CallTarget+Inlining+NGEN
This PR (6671) - mean (862ms) : 828, 895
. : milestone, 862,
master - mean (868ms) : 837, 898
. : milestone, 868,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6671) - mean (263ms) : 258, 268
. : milestone, 263,
master - mean (262ms) : 258, 267
. : milestone, 262,
section CallTarget+Inlining+NGEN
This PR (6671) - mean (838ms) : 807, 870
. : milestone, 838,
master - mean (848ms) : 818, 878
. : milestone, 848,
|
Benchmarks Report for tracer 🐌Benchmarks for #6671 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.GraphQLBenchmark - Slower
|
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net6.0 | 1.130 | 1,185.63 | 1,339.28 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | ExecuteAsync |
net6.0 | 1.19μs | 0.383ns | 1.48ns | 0.0137 | 0 | 0 | 952 B |
master | ExecuteAsync |
netcoreapp3.1 | 1.62μs | 1.5ns | 5.79ns | 0.0122 | 0 | 0 | 952 B |
master | ExecuteAsync |
net472 | 1.84μs | 0.6ns | 2.16ns | 0.145 | 0 | 0 | 915 B |
#6671 | ExecuteAsync |
net6.0 | 1.34μs | 0.673ns | 2.52ns | 0.0129 | 0 | 0 | 952 B |
#6671 | ExecuteAsync |
netcoreapp3.1 | 1.65μs | 1.01ns | 3.65ns | 0.0126 | 0 | 0 | 952 B |
#6671 | ExecuteAsync |
net472 | 1.88μs | 0.691ns | 2.68ns | 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.42μs | 1.17ns | 4.37ns | 0.0309 | 0 | 0 | 2.31 KB |
master | SendAsync |
netcoreapp3.1 | 5.35μs | 5.4ns | 19.5ns | 0.0376 | 0 | 0 | 2.85 KB |
master | SendAsync |
net472 | 7.42μs | 1.17ns | 4.37ns | 0.494 | 0 | 0 | 3.12 KB |
#6671 | SendAsync |
net6.0 | 4.43μs | 12.1ns | 46.9ns | 0.033 | 0 | 0 | 2.31 KB |
#6671 | SendAsync |
netcoreapp3.1 | 5.47μs | 2.57ns | 9.97ns | 0.0383 | 0 | 0 | 2.85 KB |
#6671 | SendAsync |
net472 | 7.48μs | 1.77ns | 6.85ns | 0.495 | 0 | 0 | 3.12 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.47μs | 0.602ns | 2.33ns | 0.0227 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
netcoreapp3.1 | 2.18μs | 0.913ns | 3.41ns | 0.0216 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
net472 | 2.54μs | 0.954ns | 3.57ns | 0.249 | 0 | 0 | 1.57 KB |
#6671 | EnrichedLog |
net6.0 | 1.52μs | 0.984ns | 3.68ns | 0.0234 | 0 | 0 | 1.64 KB |
#6671 | EnrichedLog |
netcoreapp3.1 | 2.14μs | 1.93ns | 7.23ns | 0.0225 | 0 | 0 | 1.64 KB |
#6671 | EnrichedLog |
net472 | 2.62μs | 7.64ns | 29.6ns | 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 | 113μs | 140ns | 525ns | 0.0562 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
netcoreapp3.1 | 119μs | 152ns | 590ns | 0.0595 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
net472 | 149μs | 119ns | 460ns | 0.669 | 0.223 | 0 | 4.46 KB |
#6671 | EnrichedLog |
net6.0 | 113μs | 131ns | 490ns | 0 | 0 | 0 | 4.28 KB |
#6671 | EnrichedLog |
netcoreapp3.1 | 118μs | 118ns | 455ns | 0.0588 | 0 | 0 | 4.28 KB |
#6671 | EnrichedLog |
net472 | 149μs | 162ns | 629ns | 0.67 | 0.223 | 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 | 3.09μs | 0.966ns | 3.74ns | 0.0307 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
netcoreapp3.1 | 4.1μs | 1.99ns | 7.69ns | 0.0287 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
net472 | 4.82μs | 1.91ns | 7.15ns | 0.319 | 0 | 0 | 2.02 KB |
#6671 | EnrichedLog |
net6.0 | 2.98μs | 0.852ns | 3.3ns | 0.03 | 0 | 0 | 2.2 KB |
#6671 | EnrichedLog |
netcoreapp3.1 | 4.03μs | 2.05ns | 7.95ns | 0.0282 | 0 | 0 | 2.2 KB |
#6671 | EnrichedLog |
net472 | 4.99μs | 1.24ns | 4.8ns | 0.321 | 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.776ns | 3.01ns | 0.0159 | 0 | 0 | 1.14 KB |
master | SendReceive |
netcoreapp3.1 | 1.88μs | 2.78ns | 10.8ns | 0.015 | 0 | 0 | 1.14 KB |
master | SendReceive |
net472 | 2.05μs | 0.792ns | 2.96ns | 0.183 | 0 | 0 | 1.16 KB |
#6671 | SendReceive |
net6.0 | 1.38μs | 0.656ns | 2.36ns | 0.0159 | 0 | 0 | 1.14 KB |
#6671 | SendReceive |
netcoreapp3.1 | 1.78μs | 0.842ns | 2.92ns | 0.0153 | 0 | 0 | 1.14 KB |
#6671 | SendReceive |
net472 | 2.18μs | 6.59ns | 25.5ns | 0.184 | 0 | 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.88μs | 0.712ns | 2.76ns | 0.0217 | 0 | 0 | 1.6 KB |
master | EnrichedLog |
netcoreapp3.1 | 3.82μs | 1.98ns | 7.67ns | 0.021 | 0 | 0 | 1.65 KB |
master | EnrichedLog |
net472 | 4.29μs | 4.29ns | 16ns | 0.322 | 0 | 0 | 2.04 KB |
#6671 | EnrichedLog |
net6.0 | 2.87μs | 1.54ns | 5.98ns | 0.0214 | 0 | 0 | 1.6 KB |
#6671 | EnrichedLog |
netcoreapp3.1 | 3.7μs | 2.22ns | 8.6ns | 0.0222 | 0 | 0 | 1.65 KB |
#6671 | EnrichedLog |
net472 | 4.21μs | 4.31ns | 16.7ns | 0.324 | 0 | 0 | 2.04 KB |
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️
Faster 🎉 in #6671
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑netcoreapp3.1
1.139
743.90
653.13
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑netcoreapp3.1 | 1.139 | 743.90 | 653.13 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 397ns | 0.466ns | 1.8ns | 0.00815 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 607ns | 0.892ns | 3.45ns | 0.0076 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 589ns | 0.939ns | 3.51ns | 0.0918 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 485ns | 0.717ns | 2.78ns | 0.00983 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 742ns | 2.23ns | 8.62ns | 0.00941 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 828ns | 1.73ns | 6.72ns | 0.104 | 0 | 0 | 658 B |
#6671 | StartFinishSpan |
net6.0 | 424ns | 0.522ns | 2.02ns | 0.00815 | 0 | 0 | 576 B |
#6671 | StartFinishSpan |
netcoreapp3.1 | 582ns | 0.871ns | 3.14ns | 0.00796 | 0 | 0 | 576 B |
#6671 | StartFinishSpan |
net472 | 567ns | 1.23ns | 4.76ns | 0.0918 | 0 | 0 | 578 B |
#6671 | StartFinishScope |
net6.0 | 484ns | 1.22ns | 4.72ns | 0.00978 | 0 | 0 | 696 B |
#6671 | StartFinishScope |
netcoreapp3.1 | 652ns | 1.49ns | 5.78ns | 0.00934 | 0 | 0 | 696 B |
#6671 | StartFinishScope |
net472 | 873ns | 1.74ns | 6.74ns | 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 | 643ns | 0.873ns | 3.38ns | 0.0096 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 947ns | 1.87ns | 7.23ns | 0.00917 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.09μs | 2.22ns | 8.29ns | 0.105 | 0 | 0 | 658 B |
#6671 | RunOnMethodBegin |
net6.0 | 635ns | 1.59ns | 6.14ns | 0.00987 | 0 | 0 | 696 B |
#6671 | RunOnMethodBegin |
netcoreapp3.1 | 938ns | 2.21ns | 8.54ns | 0.00948 | 0 | 0 | 696 B |
#6671 | RunOnMethodBegin |
net472 | 1.05μs | 2.35ns | 9.09ns | 0.104 | 0 | 0 | 658 B |
Summary of changes
Reduce the flake seen in Fleet installer tests
Reason for change
The fleet installer tests are currently very flaky. This is mostly due to the nightmare of trying to get the app to behave as it does elsewhere (which maybe we should just give up on, more on that later).
Implementation details
The simple details are:
ServiceMonitor.exe
before starting the app pool and sending the initial requestFirst, some history...
The design of the test app is that it starts, wait for itself to be ready to handle requests, sends a self-request, and then shuts down. This works great for Docker outside of IIS, because it means we know that we get exactly one request, once the app is ready, and the docker container exits once the sequence is complete. :chef-kiss:
On IIS, this just doesn't work. IIS does its best to make sure the app is always running. There's a bunch of other complexity. One of which is the only way to get the app running in the first place is to send a request to it, which messes with our snapshots (that's already handled). But a bigger issue is the shutdown - I just can't find a way to "wait" for it using the built-in behaviour. And without being able to wait for shutdown, we don't know exactly when the "expected" request has been sent.
So this has a hack - write to a file in the app when the app is shutting down. And spin in the powershell script, waiting for that file to exist.
Test coverage
I've run the tests repeatedly on this branch, and not seen any failures, so 🤞
Other details
Yeah, I know, the arbitrary delay could be a source of flake. I spent way too long trying to capture the output to explicitly wait for the expected output, but no matter what sort of redirection I tried, I couldn't capture it as I needed - it only writes to the redirected output when the process ends, and the process doesn't end 🙄 So yeah, this is a hack, but it works