Skip to content

[Test Optimization] ci: add run id + config keys#8071

Merged
tonyredondo merged 2 commits intomasterfrom
tony/testoptimization-performance-work-pr2
Feb 3, 2026
Merged

[Test Optimization] ci: add run id + config keys#8071
tonyredondo merged 2 commits intomasterfrom
tony/testoptimization-performance-work-pr2

Conversation

@tonyredondo
Copy link
Member

@tonyredondo tonyredondo commented Jan 15, 2026

Summary of changes

  • Introduce Test Optimization RunId and EnsureRunId with cache folder lifecycle.
  • Add _DD_INTERNAL_TOPT_RUNID to config mapping/docs and regenerate keys.
  • Update CI integration tests to set/print RunId for deterministic runs.
  • Adjust test helper thread naming for clearer CI debugging.

Reason for change

Provide a stable RunId before caching work that depends on it and keep configuration in sync.

Implementation details

  • Add RunId/EnsureRunId to ITestOptimization/TestOptimization with environment propagation.
  • Update configuration mapping and generated CI visibility keys.
  • Update CI integration tests for RunId coverage.

Test coverage

CI passes then all changes are good.

Other details

@tonyredondo tonyredondo changed the title ci: add run id + config keys [Test Optimization] ci: add run id + config keys Jan 15, 2026
@pr-commenter
Copy link

pr-commenter bot commented Jan 15, 2026

Benchmarks

Benchmark execution time: 2026-02-02 15:36:28

Comparing candidate commit f0e013a in PR branch tony/testoptimization-performance-work-pr2 with baseline commit 22b8edf in branch master.

Found 6 performance improvements and 5 performance regressions! Performance is the same for 165 metrics, 16 unstable metrics.

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net6.0

  • 🟥 execution_time [+21.494ms; +27.900ms] or [+10.629%; +13.797%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody netcoreapp3.1

  • 🟥 execution_time [+20.176ms; +26.143ms] or [+10.292%; +13.335%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody netcoreapp3.1

  • 🟩 execution_time [-18.181ms; -13.574ms] or [-8.547%; -6.381%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net6.0

  • 🟥 execution_time [+20.066ms; +24.046ms] or [+10.170%; +12.188%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net6.0

  • 🟥 execution_time [+26.224ms; +26.616ms] or [+15.096%; +15.322%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest netcoreapp3.1

  • 🟩 throughput [+582.095op/s; +1340.432op/s] or [+6.114%; +14.080%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1

  • 🟩 execution_time [-72.947ms; -68.750ms] or [-32.223%; -30.369%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net6.0

  • 🟩 throughput [+37532.931op/s; +47817.413op/s] or [+7.117%; +9.067%]

scenario:Benchmarks.Trace.NLogBenchmark.EnrichedLog netcoreapp3.1

  • 🟩 execution_time [-87.861ms; -86.315ms] or [-43.962%; -43.189%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore netcoreapp3.1

  • 🟥 throughput [-16094860.326op/s; -14831454.353op/s] or [-6.679%; -6.154%]

scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

  • 🟩 execution_time [-20.191ms; -15.101ms] or [-9.413%; -7.040%]

@datadog-official

This comment has been minimized.

@dd-trace-dotnet-ci-bot
Copy link

dd-trace-dotnet-ci-bot bot commented Jan 15, 2026

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8071) and master.

✅ No regressions detected - check the details below

Full Metrics Comparison

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration68.51 ± (68.51 - 68.72) ms68.46 ± (68.50 - 68.71) ms-0.1%
.NET Framework 4.8 - Bailout
duration72.26 ± (72.11 - 72.37) ms72.36 ± (72.40 - 72.62) ms+0.1%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1002.32 ± (1012.44 - 1023.99) ms1006.41 ± (1009.60 - 1017.47) ms+0.4%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms21.78 ± (21.74 - 21.81) ms21.88 ± (21.85 - 21.91) ms+0.5%✅⬆️
process.time_to_main_ms78.73 ± (78.57 - 78.90) ms79.09 ± (78.92 - 79.25) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.90 ± (10.90 - 10.91) MB10.89 ± (10.89 - 10.90) MB-0.1%
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms21.73 ± (21.71 - 21.75) ms21.82 ± (21.80 - 21.84) ms+0.4%✅⬆️
process.time_to_main_ms79.97 ± (79.87 - 80.07) ms80.15 ± (80.03 - 80.26) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.95 ± (10.94 - 10.95) MB10.93 ± (10.93 - 10.94) MB-0.2%
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms251.62 ± (248.50 - 254.74) ms250.00 ± (246.94 - 253.06) ms-0.6%
process.time_to_main_ms471.84 ± (471.18 - 472.49) ms472.45 ± (471.93 - 472.98) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.39 ± (48.36 - 48.41) MB48.37 ± (48.34 - 48.39) MB-0.0%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.2%
.NET 6 - Baseline
process.internal_duration_ms20.64 ± (20.62 - 20.67) ms20.66 ± (20.64 - 20.69) ms+0.1%✅⬆️
process.time_to_main_ms68.44 ± (68.34 - 68.54) ms68.73 ± (68.62 - 68.84) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.62 ± (10.61 - 10.62) MB10.63 ± (10.63 - 10.64) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms20.52 ± (20.50 - 20.54) ms20.57 ± (20.55 - 20.59) ms+0.2%✅⬆️
process.time_to_main_ms69.16 ± (69.11 - 69.21) ms69.60 ± (69.54 - 69.66) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.66 ± (10.66 - 10.67) MB10.72 ± (10.71 - 10.73) MB+0.5%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms244.45 ± (242.06 - 246.83) ms249.79 ± (248.33 - 251.26) ms+2.2%✅⬆️
process.time_to_main_ms447.00 ± (446.46 - 447.54) ms451.00 ± (450.46 - 451.54) ms+0.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.15 ± (49.12 - 49.18) MB49.21 ± (49.17 - 49.24) MB+0.1%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms18.81 ± (18.78 - 18.84) ms18.80 ± (18.78 - 18.82) ms-0.1%
process.time_to_main_ms67.26 ± (67.16 - 67.35) ms67.68 ± (67.58 - 67.79) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.65 ± (7.64 - 7.66) MB7.67 ± (7.66 - 7.67) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms18.78 ± (18.76 - 18.81) ms18.86 ± (18.83 - 18.89) ms+0.4%✅⬆️
process.time_to_main_ms68.37 ± (68.31 - 68.44) ms68.77 ± (68.72 - 68.83) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.71 ± (7.70 - 7.71) MB7.71 ± (7.70 - 7.72) MB+0.0%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms177.33 ± (176.47 - 178.19) ms178.09 ± (177.04 - 179.15) ms+0.4%✅⬆️
process.time_to_main_ms430.32 ± (429.52 - 431.12) ms432.14 ± (431.46 - 432.83) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.54 ± (36.51 - 36.57) MB36.58 ± (36.56 - 36.61) MB+0.1%✅⬆️
runtime.dotnet.threads.count27 ± (26 - 27)27 ± (27 - 27)+0.5%✅⬆️

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration193.66 ± (193.44 - 194.16) ms195.44 ± (196.29 - 197.31) ms+0.9%✅⬆️
.NET Framework 4.8 - Bailout
duration197.07 ± (196.90 - 197.47) ms201.32 ± (201.21 - 202.17) ms+2.2%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1136.56 ± (1138.57 - 1149.46) ms1162.42 ± (1164.01 - 1174.20) ms+2.3%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms187.90 ± (187.53 - 188.27) ms191.91 ± (191.44 - 192.39) ms+2.1%✅⬆️
process.time_to_main_ms81.02 ± (80.77 - 81.26) ms82.66 ± (82.40 - 82.93) ms+2.0%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.08 ± (16.05 - 16.11) MB16.07 ± (16.05 - 16.10) MB-0.0%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.2%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms188.45 ± (188.03 - 188.87) ms189.51 ± (189.11 - 189.91) ms+0.6%✅⬆️
process.time_to_main_ms82.80 ± (82.59 - 83.00) ms83.38 ± (83.17 - 83.58) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.13 ± (16.11 - 16.16) MB16.10 ± (16.08 - 16.12) MB-0.2%
runtime.dotnet.threads.count21 ± (20 - 21)21 ± (21 - 21)+0.3%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms435.57 ± (432.95 - 438.20) ms433.17 ± (430.09 - 436.24) ms-0.6%
process.time_to_main_ms473.27 ± (472.70 - 473.85) ms480.46 ± (479.74 - 481.18) ms+1.5%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.76 ± (58.64 - 58.87) MB58.69 ± (58.57 - 58.81) MB-0.1%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.0%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms191.68 ± (191.35 - 192.01) ms196.25 ± (195.77 - 196.73) ms+2.4%✅⬆️
process.time_to_main_ms69.98 ± (69.78 - 70.18) ms71.61 ± (71.37 - 71.85) ms+2.3%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed15.81 ± (15.64 - 15.98) MB16.34 ± (16.32 - 16.36) MB+3.3%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)19 ± (19 - 19)+5.6%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms191.24 ± (190.90 - 191.57) ms193.49 ± (193.04 - 193.94) ms+1.2%✅⬆️
process.time_to_main_ms71.15 ± (71.02 - 71.28) ms72.07 ± (71.89 - 72.26) ms+1.3%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.16 ± (16.03 - 16.30) MB16.24 ± (16.14 - 16.33) MB+0.5%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)20 ± (20 - 20)+2.8%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms442.87 ± (439.56 - 446.18) ms445.86 ± (442.11 - 449.61) ms+0.7%✅⬆️
process.time_to_main_ms450.86 ± (450.37 - 451.35) ms464.07 ± (462.93 - 465.21) ms+2.9%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed59.03 ± (58.91 - 59.14) MB59.10 ± (58.94 - 59.27) MB+0.1%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.2%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms190.37 ± (190.03 - 190.71) ms192.09 ± (191.69 - 192.48) ms+0.9%✅⬆️
process.time_to_main_ms69.98 ± (69.79 - 70.17) ms70.40 ± (70.20 - 70.61) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.73 ± (11.70 - 11.75) MB11.71 ± (11.68 - 11.74) MB-0.1%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)+0.4%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms189.61 ± (189.28 - 189.94) ms193.05 ± (192.57 - 193.54) ms+1.8%✅⬆️
process.time_to_main_ms71.26 ± (71.15 - 71.36) ms72.15 ± (71.95 - 72.36) ms+1.3%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.80 ± (11.78 - 11.83) MB11.76 ± (11.75 - 11.78) MB-0.3%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.1%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms368.05 ± (366.32 - 369.77) ms367.90 ± (366.49 - 369.30) ms-0.0%
process.time_to_main_ms436.90 ± (436.18 - 437.62) ms439.51 ± (438.78 - 440.24) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed48.15 ± (48.11 - 48.19) MB48.21 ± (48.18 - 48.25) MB+0.1%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)28 ± (28 - 29)-0.8%
Comparison explanation

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 highlighted 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).

Duration charts
FakeDbCommand (.NET Framework 4.8)
gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8071) - mean (69ms)  : 67, 70
    master - mean (69ms)  : 67, 70

    section Bailout
    This PR (8071) - mean (73ms)  : 71, 74
    master - mean (72ms)  : 71, 74

    section CallTarget+Inlining+NGEN
    This PR (8071) - mean (1,014ms)  : 958, 1069
    master - mean (1,018ms)  : 933, 1104

Loading
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 (8071) - mean (106ms)  : 103, 110
    master - mean (106ms)  : 103, 109

    section Bailout
    This PR (8071) - mean (107ms)  : 106, 108
    master - mean (107ms)  : 105, 108

    section CallTarget+Inlining+NGEN
    This PR (8071) - mean (746ms)  : 690, 802
    master - mean (748ms)  : 703, 794

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8071) - mean (94ms)  : 92, 96
    master - mean (94ms)  : 92, 96

    section Bailout
    This PR (8071) - mean (95ms)  : 94, 96
    master - mean (94ms)  : 93, 95

    section CallTarget+Inlining+NGEN
    This PR (8071) - mean (726ms)  : 691, 761
    master - mean (716ms)  : 680, 752

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8071) - mean (93ms)  : 90, 95
    master - mean (92ms)  : 89, 95

    section Bailout
    This PR (8071) - mean (94ms)  : 92, 95
    master - mean (93ms)  : 92, 94

    section CallTarget+Inlining+NGEN
    This PR (8071) - mean (637ms)  : 624, 650
    master - mean (635ms)  : 622, 648

Loading
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 (8071) - mean (197ms)  : 189, 204
    master - mean (194ms)  : 190, 197

    section Bailout
    This PR (8071) - mean (202ms)  : 197, 206
    master - mean (197ms)  : 195, 200

    section CallTarget+Inlining+NGEN
    This PR (8071) - mean (1,169ms)  : 1091, 1247
    master - mean (1,144ms)  : 1061, 1227

Loading
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 (8071) - mean (283ms)  : 275, 291
    master - mean (278ms)  : 272, 283

    section Bailout
    This PR (8071) - mean (281ms)  : 274, 289
    master - mean (280ms)  : 271, 288

    section CallTarget+Inlining+NGEN
    This PR (8071) - mean (945ms)  : 907, 983
    master - mean (936ms)  : 901, 972

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8071) - mean (276ms)  : 268, 284
    master - mean (270ms)  : 265, 275

    section Bailout
    This PR (8071) - mean (274ms)  : 267, 281
    master - mean (271ms)  : 266, 276

    section CallTarget+Inlining+NGEN
    This PR (8071) - mean (943ms)  : 890, 997
    master - mean (924ms)  : 879, 969

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8071) - mean (272ms)  : 266, 279
    master - mean (270ms)  : 265, 275

    section Bailout
    This PR (8071) - mean (275ms)  : 265, 285
    master - mean (270ms)  : 266, 275

    section CallTarget+Inlining+NGEN
    This PR (8071) - mean (841ms)  : 824, 857
    master - mean (836ms)  : 815, 857

Loading

@tonyredondo tonyredondo force-pushed the tony/testoptimization-performance-work-pr1 branch from ad6c32d to f0ccdd2 Compare January 15, 2026 22:06
@tonyredondo tonyredondo force-pushed the tony/testoptimization-performance-work-pr2 branch 3 times, most recently from a92777c to d0595bf Compare January 16, 2026 12:31
@tonyredondo tonyredondo force-pushed the tony/testoptimization-performance-work-pr1 branch from 7a2fadb to c58aa40 Compare January 16, 2026 12:39
@tonyredondo tonyredondo force-pushed the tony/testoptimization-performance-work-pr2 branch from d0595bf to 7216d32 Compare January 16, 2026 12:39
Comment on lines +469 to +498
try
{
var cacheFolder = Path.Combine(baseDirectory ?? CIValues.WorkspacePath ?? Environment.CurrentDirectory, ".dd", runId);
Log.Debug("TestOptimization: Creating cache folder: {Folder}", cacheFolder);
if (!Directory.Exists(cacheFolder))
{
Directory.CreateDirectory(cacheFolder);
}

LifetimeManager.Instance.AddShutdownTask(_ =>
{
try
{
Log.Debug("TestOptimization: Removing cache folder: {Folder}", cacheFolder);
if (Directory.Exists(cacheFolder))
{
Directory.Delete(cacheFolder, true);
}
}
catch (Exception exInner)
{
Log.Warning(exInner, "TestOptimization: Error deleting cache folder.");
}
});
}
catch (Exception ex)
{
Log.Warning(ex, "TestOptimization: Error creating cache folder.");
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

If we are the one creating the RunId for children processes then we are the owners of the temporary folder for the cache of the run.

Comment on lines +72 to +73
protected static bool IsMacOS()
=> string.Equals(FrameworkDescription.Instance.OSPlatform, OSPlatformName.MacOS, StringComparison.OrdinalIgnoreCase);
Copy link
Member Author

Choose a reason for hiding this comment

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

when running on Rider in the mac, all tests deadlock because the UDPClient.Close call when we have statsd. So to be able to run and debug the tests, we are identifying the macOs platform and use this boolean when creating the mock agent.
This doesn't affect actual test because we don't do integration tests on mac.

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe this could be added as comment where IsMacOS is used

Comment on lines +420 to +421
runId = Guid.NewGuid().ToString("n");
SetEnvironmentVariable(ConfigurationKeys.CIVisibility.TestOptimizationRunId, runId);
Copy link
Member Author

Choose a reason for hiding this comment

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

We need to create the RunId manually for each test iteration to avoid using the current one created by the TestOptimizationClient. because the RunId is being used to create a cache folder we need to invalidate that cache in each run.

using var logsIntake = new MockLogsIntakeForCiVisibility();
EnableDirectLogSubmission(logsIntake.Port, nameof(IntegrationId.XUnit), nameof(XUnitTests));
using var agent = EnvironmentHelper.GetMockAgent(useStatsD: true);
using var agent = EnvironmentHelper.GetMockAgent(useStatsD: !IsMacOS());
Copy link
Member Author

Choose a reason for hiding this comment

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

and here is the IsMacOS() usage

Comment on lines +435 to +439
var thread = new Thread(DoWork)
{
IsBackground = true,
Name = "ConcurrentRunner:" + i
};
Copy link
Member Author

Choose a reason for hiding this comment

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

Just adding a name to those ConcurrentRunner threads to improve debugging in the IDE.

@tonyredondo tonyredondo marked this pull request as ready for review January 16, 2026 13:01
@tonyredondo tonyredondo requested review from a team as code owners January 16, 2026 13:01
@tonyredondo tonyredondo force-pushed the tony/testoptimization-performance-work-pr2 branch 2 times, most recently from 4a70c7a to b3116fd Compare January 19, 2026 09:27
@tonyredondo tonyredondo force-pushed the tony/testoptimization-performance-work-pr1 branch from 4a649b1 to 3f3f143 Compare January 23, 2026 13:55
@tonyredondo tonyredondo requested review from a team as code owners January 23, 2026 13:55
@tonyredondo tonyredondo force-pushed the tony/testoptimization-performance-work-pr2 branch from b3116fd to 643a4d8 Compare January 23, 2026 14:46
@tonyredondo tonyredondo force-pushed the tony/testoptimization-performance-work-pr2 branch from 643a4d8 to 36cf4ce Compare January 23, 2026 17:27
Copy link
Collaborator

@bouwkast bouwkast left a comment

Choose a reason for hiding this comment

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

👍

tonyredondo added a commit that referenced this pull request Jan 30, 2026
## Summary of changes
- Add FixedSizeArrayPool and logger overloads to reduce per-log
allocations.
- Add RefStopwatch/StopwatchHelpers/CodeDuration and apply timing to
TraceClock/TracerManagerFactory/Instrumentation and CI processors.
- Lower init logs to Debug for CI protocol writer/sender and processors.

## Reason for change
Reduce allocations and improve timing diagnostics in hot paths.

## Implementation details
- New utility helpers in `Datadog.Trace.Util` for allocation-free timing
and pooling.
- Logging changes to avoid params array allocations in common log paths.
- Timing/log-level tweaks in CI protocol writer/sender and trace
processors.

## Test coverage
CI passes then all changes are good.

## Other details
- Stacked PRs (current marked):
- **CURRENT**: PR1 #8070
  - PR2 #8071
  - PR3 #8072
  - PR4 #8073
Base automatically changed from tony/testoptimization-performance-work-pr1 to master January 30, 2026 15:33
@tonyredondo tonyredondo force-pushed the tony/testoptimization-performance-work-pr2 branch from 36cf4ce to 1e2d8dd Compare February 2, 2026 12:55
Comment on lines +72 to +73
protected static bool IsMacOS()
=> string.Equals(FrameworkDescription.Instance.OSPlatform, OSPlatformName.MacOS, StringComparison.OrdinalIgnoreCase);
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe this could be added as comment where IsMacOS is used

@tonyredondo tonyredondo merged commit a6ca856 into master Feb 3, 2026
142 checks passed
@tonyredondo tonyredondo deleted the tony/testoptimization-performance-work-pr2 branch February 3, 2026 09:23
@github-actions github-actions bot added this to the vNext-v3 milestone Feb 3, 2026
tonyredondo added a commit that referenced this pull request Feb 3, 2026
## Summary of changes
- Add git command caching and telemetry improvements for CI visibility.
- Update GitInfo discovery and CI environment logging.
- Update impacted tests for new git discovery behavior.

JIRA: SDTEST-3226

## Reason for change
Reduce git command overhead and improve visibility into CI git metadata
collection.

## Implementation details
- Disk cache keyed by RunId in GitCommandHelper with safe.directory
handling.
- JSON annotations in ProcessHelpers for cache serialization.
- Adjusted CI runner git discovery logic and tests.

## Test coverage
CI passes then all changes are good.

## Other details
- Stacked PRs (current marked):
  - PR1 #8070
  - PR2 #8071
- **CURRENT**: PR3 #8072
  - PR4 #8073
tonyredondo added a commit that referenced this pull request Feb 3, 2026
## Summary of changes
- Add cached/file Test Optimization clients and update client wrappers.
- Reduce feature init overhead and adjust background initialization.
- Improve runner logging and CI workspace cache usage.

## Reason for change
Reduce repeated HTTP calls and improve initialization performance for CI
visibility features.

## Implementation details
- New cached/file client implementations for disk/memory caching.
- Feature creation updated to reduce dependencies on client calls.
- CodeDuration instrumentation added to CI initialization paths.

## Test coverage
CI passes then all changes are good.

## Other details
- Stacked PRs (current marked):
  - PR1 #8070
  - PR2 #8071
  - PR3 #8072
- **CURRENT**: PR4 #8073
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants