[ADO.NET] Fix flaky Microsoft.Data.SqlClient test#8928
Conversation
BenchmarksBenchmark execution time: 2026-07-23 09:27:43 Comparing candidate commit 45114f7 in PR branch Found 0 performance improvements and 1 performance regressions! Performance is the same for 71 metrics, 0 unstable metrics, 63 known flaky benchmarks, 63 flaky benchmarks without significant changes.
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8928) 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 (8928) - mean (74ms) : 70, 78
master - mean (74ms) : 69, 78
section Bailout
This PR (8928) - mean (81ms) : 76, 86
master - mean (78ms) : 74, 82
section CallTarget+Inlining+NGEN
This PR (8928) - mean (1,093ms) : 1046, 1139
master - mean (1,092ms) : 1042, 1141
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 (8928) - mean (115ms) : 109, 121
master - mean (114ms) : 109, 120
section Bailout
This PR (8928) - mean (113ms) : 108, 118
master - mean (112ms) : 108, 116
section CallTarget+Inlining+NGEN
This PR (8928) - mean (785ms) : 761, 810
master - mean (785ms) : 762, 808
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8928) - mean (102ms) : 95, 109
master - mean (97ms) : 95, 100
section Bailout
This PR (8928) - mean (103ms) : 96, 109
master - mean (102ms) : 95, 109
section CallTarget+Inlining+NGEN
This PR (8928) - mean (945ms) : 907, 984
master - mean (943ms) : 903, 984
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8928) - mean (96ms) : 94, 99
master - mean (98ms) : 93, 103
section Bailout
This PR (8928) - mean (101ms) : 94, 108
master - mean (97ms) : 96, 99
section CallTarget+Inlining+NGEN
This PR (8928) - mean (819ms) : 783, 856
master - mean (829ms) : 781, 877
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 (8928) - mean (205ms) : 198, 211
master - mean (210ms) : 201, 219
section Bailout
This PR (8928) - mean (207ms) : 203, 211
master - mean (212ms) : 205, 219
section CallTarget+Inlining+NGEN
This PR (8928) - mean (1,232ms) : 1172, 1293
master - mean (1,246ms) : 1194, 1297
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 (8928) - mean (294ms) : 283, 305
master - mean (304ms) : 290, 317
section Bailout
This PR (8928) - mean (296ms) : 282, 310
master - mean (308ms) : 290, 327
section CallTarget+Inlining+NGEN
This PR (8928) - mean (986ms) : 963, 1010
master - mean (1,002ms) : 976, 1027
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8928) - mean (289ms) : 280, 299
master - mean (298ms) : 281, 315
section Bailout
This PR (8928) - mean (295ms) : 281, 310
master - mean (292ms) : 280, 305
section CallTarget+Inlining+NGEN
This PR (8928) - mean (1,184ms) : 1140, 1227
master - mean (1,189ms) : 1147, 1231
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8928) - mean (290ms) : 279, 301
master - mean (292ms) : 277, 307
section Bailout
This PR (8928) - mean (297ms) : 280, 314
master - mean (301ms) : 283, 319
section CallTarget+Inlining+NGEN
This PR (8928) - mean (1,079ms) : 989, 1169
master - mean (1,095ms) : 985, 1205
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SetEnvironmentVariable("DD_TRACE_PARTIAL_FLUSH_ENABLED", "true"); | ||
| SetEnvironmentVariable("DD_TRACE_PARTIAL_FLUSH_MIN_SPANS", "20"); |
There was a problem hiding this comment.
Ah we may need to enable this for all of them as I was just manually calling this 🤔
Are we sure that this is what happened 🤔 I'm wondering, because the size of the trace is deterministic, so if we're flushing before each trace is written it should be deterministic I think? Did we check the logs and see that it was explicitly dropped due to an overfull buffer? |
We got this: 2026-07-21 11:50:37.805 +00:00 [WRN] 1 traces were dropped since the last flush operation. { MachineName: ".", Process: "[3883 dotnet]", AppDomain: "[1 Samples.Microsoft.Data.SqlClient]", AssemblyLoadContext: """ Datadog.Trace.ClrProfiler.Managed.Loader.ManagedProfilerAssemblyLoadContext #1", TracerVersion: "3.50.0.0" } It seems that this message could mean either that the individual trace could not fit or buffers being unavailable/full. |
Related PR: https://github.com/DataDog/dd-trace-dotnet/pull/8931/changes |
Summary of changes
Update the
Microsoft.Data.SqlClientsample to complete and flush each command executor trace before starting the next one. The shared database harness exposes this as opt-in behavior, preserving the existing behavior for other database samples.Reason for change
The test has been detected as flaky when the first large trace is dropped before reaching the mock agent.
Splitting the workload into smaller completed traces and flushing each one makes delivery deterministic without changing the tracer configuration used by the test. Only the sample detected as flaky opts into this behavior.
Test coverage