Serialize RuntimeIdTests and HttpHeaderHelperTests to remove telemetry header flake#8638
Conversation
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8638) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-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 highlighted 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). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8638) - mean (74ms) : 71, 78
master - mean (73ms) : 70, 77
section Bailout
This PR (8638) - mean (77ms) : 74, 80
master - mean (79ms) : 75, 83
section CallTarget+Inlining+NGEN
This PR (8638) - mean (1,107ms) : 1057, 1157
master - mean (1,112ms) : 1053, 1172
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8638) - mean (115ms) : 110, 120
master - mean (117ms) : 111, 123
section Bailout
This PR (8638) - mean (115ms) : 112, 119
master - mean (116ms) : 112, 121
section CallTarget+Inlining+NGEN
This PR (8638) - mean (797ms) : 770, 823
master - mean (794ms) : 764, 824
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8638) - mean (104ms) : 98, 111
master - mean (102ms) : 97, 106
section Bailout
This PR (8638) - mean (103ms) : 99, 107
master - mean (104ms) : 99, 110
section CallTarget+Inlining+NGEN
This PR (8638) - mean (947ms) : 914, 979
master - mean (948ms) : 896, 1000
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8638) - mean (100ms) : 97, 103
master - mean (99ms) : 96, 102
section Bailout
This PR (8638) - mean (106ms) : 102, 110
master - mean (103ms) : 98, 108
section CallTarget+Inlining+NGEN
This PR (8638) - mean (822ms) : 788, 856
master - mean (823ms) : 786, 860
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8638) - mean (197ms) : 192, 201
master - mean (200ms) : 195, 205
section Bailout
This PR (8638) - mean (200ms) : 196, 205
master - mean (203ms) : 197, 210
section CallTarget+Inlining+NGEN
This PR (8638) - mean (1,187ms) : 1146, 1229
master - mean (1,199ms) : 1157, 1242
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8638) - mean (283ms) : 277, 289
master - mean (286ms) : 273, 300
section Bailout
This PR (8638) - mean (283ms) : 276, 291
master - mean (288ms) : 281, 295
section CallTarget+Inlining+NGEN
This PR (8638) - mean (957ms) : 928, 986
master - mean (966ms) : 937, 995
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8638) - mean (276ms) : 271, 281
master - mean (281ms) : 270, 291
section Bailout
This PR (8638) - mean (275ms) : 271, 279
master - mean (280ms) : 270, 290
section CallTarget+Inlining+NGEN
This PR (8638) - mean (1,153ms) : 1115, 1191
master - mean (1,161ms) : 1117, 1205
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8638) - mean (275ms) : 269, 281
master - mean (280ms) : 270, 290
section Bailout
This PR (8638) - mean (274ms) : 268, 280
master - mean (279ms) : 269, 290
section CallTarget+Inlining+NGEN
This PR (8638) - mean (1,034ms) : 985, 1082
master - mean (1,042ms) : 999, 1085
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BenchmarksBenchmark execution time: 2026-05-22 11:36:33 Comparing candidate commit 910ea94 in PR branch Some scenarios are present only in baseline or only in candidate runs. If you didn't create or remove some scenarios in your branch, this maybe a sign of crashed benchmarks 💥💥💥 Scenarios present only in baseline:
Found 6 performance improvements and 9 performance regressions! Performance is the same for 45 metrics, 12 unstable metrics, 93 known flaky benchmarks, 33 flaky benchmarks without significant changes.
|
|
andrewlock
left a comment
There was a problem hiding this comment.
Thanks, I think we only need it on RuntimeIdTests though. And I'd rather we instead re-wrote RuntimeId to not be inherently flaky 😭
Co-authored-by: Andrew Lock <[email protected]>
…erTests.cs Co-authored-by: Andrew Lock <[email protected]>
Sure! I will take it as a pending task that could be addressed in a subsequent PR. |
Summary of changes
Add
[Collection(nameof(EnvironmentVariablesTestCollection))]toRuntimeIdTestsso they cannot run in parallel.Reason for change
HttpHeaderHelperTests.TelemetryAgentHttpHeaderHelper_WritesExpectedHeadersflaked in build 201656:expectedincludedDD-Root-Session-ID: inherited-root-session-id,actualdid not.RuntimeIdTeststransiently setsRuntimeId._rootSessionId = "inherited-root-session-id"before restoring it infinally. xUnit runs test classes in parallel, and the log confirmsRuntimeIdTests(6ms) ran insideHttpHeaderHelperTests's 146ms window. The race:helper.DefaultHeadersread fresh during the mutation window →expectedincludes the root header.helper.WriteLeadingHeaderspopulated the once-per-process cacheTelemetryHttpHeaderNames._httpSerializedDefaultAgentHeadersafterRuntimeIdTestsrestored state →actuallacks it.Implementation details
RuntimeIdTests.cs— gains[Collection(...)]. It already mutates_DD_ROOT_DOTNET_SESSION_ID, so it belongs here anyway.Production code is unchanged: the lazy cache and static field are fine because
_rootSessionIdis set once at startup in real runs.Test coverage
No new tests — existing coverage is preserved, just no longer racing.
Other details