Skip to content

Increase timeout DiscoveryService Tests#8118

Merged
NachoEchevarria merged 13 commits intomasterfrom
nacho/DiscoveryFlakyTests
Feb 4, 2026
Merged

Increase timeout DiscoveryService Tests#8118
NachoEchevarria merged 13 commits intomasterfrom
nacho/DiscoveryFlakyTests

Conversation

@NachoEchevarria
Copy link
Collaborator

@NachoEchevarria NachoEchevarria commented Jan 30, 2026

Summary of changes

Increases mutex timeouts from 10s to 30s in DiscoveryServiceTests to reduce flakiness on slow CI environments.

Reason for change

Three DiscoveryServiceTests tests were intermittently failing.

Implementation details

  • Increased mutex.Wait timeouts from 10,000ms to 30,000ms across affected tests

Test coverage

Other details

@github-actions github-actions bot added the area:tests unit tests, integration tests label Jan 30, 2026
@dd-trace-dotnet-ci-bot
Copy link

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

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8118) 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
duration77.59 ± (77.59 - 78.00) ms78.78 ± (78.54 - 78.94) ms+1.5%✅⬆️
.NET Framework 4.8 - Bailout
duration82.54 ± (82.48 - 82.87) ms81.74 ± (81.53 - 81.97) ms-1.0%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1116.65 ± (1117.55 - 1126.17) ms1113.73 ± (1114.46 - 1121.45) ms-0.3%
.NET Core 3.1 - Baseline
process.internal_duration_ms24.65 ± (24.59 - 24.72) ms24.44 ± (24.38 - 24.50) ms-0.9%
process.time_to_main_ms101.21 ± (100.95 - 101.47) ms100.94 ± (100.72 - 101.16) ms-0.3%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed15.50 ± (15.50 - 15.50) MB15.53 ± (15.53 - 15.53) MB+0.2%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms24.66 ± (24.59 - 24.73) ms24.46 ± (24.39 - 24.54) ms-0.8%
process.time_to_main_ms102.75 ± (102.49 - 103.02) ms102.87 ± (102.60 - 103.15) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed15.56 ± (15.56 - 15.57) MB15.53 ± (15.53 - 15.54) MB-0.2%
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms292.86 ± (290.56 - 295.16) ms288.69 ± (285.41 - 291.97) ms-1.4%
process.time_to_main_ms567.06 ± (566.04 - 568.09) ms563.53 ± (562.79 - 564.27) ms-0.6%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed53.15 ± (53.12 - 53.17) MB53.17 ± (53.14 - 53.19) MB+0.0%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.1%
.NET 6 - Baseline
process.internal_duration_ms23.23 ± (23.16 - 23.31) ms23.24 ± (23.18 - 23.30) ms+0.0%✅⬆️
process.time_to_main_ms88.00 ± (87.75 - 88.25) ms88.14 ± (87.92 - 88.36) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed15.22 ± (15.21 - 15.22) MB15.23 ± (15.22 - 15.23) MB+0.1%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms23.09 ± (23.02 - 23.15) ms23.23 ± (23.16 - 23.30) ms+0.6%✅⬆️
process.time_to_main_ms89.21 ± (88.96 - 89.46) ms90.17 ± (89.97 - 90.37) ms+1.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed15.34 ± (15.34 - 15.35) MB15.34 ± (15.34 - 15.34) MB-0.0%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms278.23 ± (277.26 - 279.21) ms280.53 ± (279.34 - 281.72) ms+0.8%✅⬆️
process.time_to_main_ms532.53 ± (531.60 - 533.45) ms536.63 ± (535.77 - 537.48) ms+0.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed53.85 ± (53.83 - 53.87) MB53.91 ± (53.89 - 53.93) MB+0.1%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.0%
.NET 8 - Baseline
process.internal_duration_ms21.18 ± (21.12 - 21.23) ms21.17 ± (21.11 - 21.23) ms-0.0%
process.time_to_main_ms86.09 ± (85.88 - 86.30) ms86.20 ± (85.97 - 86.42) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed12.25 ± (12.25 - 12.26) MB12.27 ± (12.26 - 12.27) MB+0.1%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms20.94 ± (20.88 - 21.00) ms21.08 ± (21.02 - 21.13) ms+0.6%✅⬆️
process.time_to_main_ms86.90 ± (86.66 - 87.13) ms87.68 ± (87.46 - 87.90) ms+0.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed12.31 ± (12.30 - 12.32) MB12.31 ± (12.30 - 12.32) MB-0.0%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms203.93 ± (203.07 - 204.79) ms207.63 ± (206.78 - 208.48) ms+1.8%✅⬆️
process.time_to_main_ms511.37 ± (510.30 - 512.44) ms517.74 ± (516.90 - 518.57) ms+1.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed41.70 ± (41.68 - 41.73) MB41.65 ± (41.61 - 41.68) MB-0.1%
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)+0.0%✅⬆️

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration202.57 ± (202.47 - 203.42) ms209.57 ± (209.28 - 210.31) ms+3.5%✅⬆️
.NET Framework 4.8 - Bailout
duration207.98 ± (207.65 - 208.81) ms211.27 ± (211.10 - 212.21) ms+1.6%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1196.57 ± (1196.46 - 1205.18) ms1193.41 ± (1193.75 - 1200.92) ms-0.3%
.NET Core 3.1 - Baseline
process.internal_duration_ms203.29 ± (202.81 - 203.77) ms205.39 ± (204.86 - 205.93) ms+1.0%✅⬆️
process.time_to_main_ms94.62 ± (94.36 - 94.88) ms95.27 ± (95.00 - 95.54) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed20.58 ± (20.56 - 20.59) MB20.58 ± (20.57 - 20.60) MB+0.0%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.1%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms204.95 ± (204.42 - 205.48) ms205.22 ± (204.69 - 205.74) ms+0.1%✅⬆️
process.time_to_main_ms96.47 ± (96.20 - 96.75) ms96.61 ± (96.37 - 96.85) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed20.59 ± (20.57 - 20.61) MB20.65 ± (20.63 - 20.66) MB+0.3%✅⬆️
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)-0.3%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms459.65 ± (457.28 - 462.02) ms465.50 ± (462.89 - 468.12) ms+1.3%✅⬆️
process.time_to_main_ms534.26 ± (533.12 - 535.40) ms540.40 ± (539.17 - 541.63) ms+1.1%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed62.91 ± (62.76 - 63.06) MB62.53 ± (62.37 - 62.70) MB-0.6%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.0%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms207.48 ± (206.92 - 208.03) ms213.56 ± (212.90 - 214.22) ms+2.9%✅⬆️
process.time_to_main_ms81.86 ± (81.61 - 82.11) ms83.48 ± (83.23 - 83.73) ms+2.0%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed20.87 ± (20.85 - 20.89) MB20.76 ± (20.74 - 20.77) MB-0.6%
runtime.dotnet.threads.count20 ± (19 - 20)20 ± (20 - 20)+0.8%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms207.45 ± (206.93 - 207.97) ms213.81 ± (213.00 - 214.63) ms+3.1%✅⬆️
process.time_to_main_ms83.34 ± (83.12 - 83.57) ms85.70 ± (85.40 - 86.01) ms+2.8%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed20.92 ± (20.90 - 20.94) MB20.84 ± (20.82 - 20.85) MB-0.4%
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)+0.2%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms476.67 ± (474.73 - 478.61) ms484.61 ± (482.53 - 486.68) ms+1.7%✅⬆️
process.time_to_main_ms502.55 ± (501.50 - 503.61) ms513.90 ± (512.92 - 514.87) ms+2.3%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed62.74 ± (62.64 - 62.85) MB62.53 ± (62.41 - 62.64) MB-0.3%
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+0.4%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms203.48 ± (203.00 - 203.97) ms212.25 ± (211.55 - 212.95) ms+4.3%✅⬆️
process.time_to_main_ms79.67 ± (79.42 - 79.92) ms82.54 ± (82.31 - 82.76) ms+3.6%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.25 ± (16.24 - 16.27) MB16.13 ± (16.12 - 16.15) MB-0.7%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.4%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms201.38 ± (200.87 - 201.89) ms214.12 ± (213.21 - 215.03) ms+6.3%✅⬆️
process.time_to_main_ms80.44 ± (80.28 - 80.59) ms84.67 ± (84.37 - 84.97) ms+5.3%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.36 ± (16.34 - 16.37) MB16.15 ± (16.14 - 16.17) MB-1.3%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.8%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms413.80 ± (406.88 - 420.72) ms457.95 ± (450.24 - 465.67) ms+10.7%✅⬆️
process.time_to_main_ms489.24 ± (488.24 - 490.25) ms499.45 ± (498.47 - 500.43) ms+2.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed54.21 ± (54.05 - 54.38) MB54.84 ± (54.73 - 54.96) MB+1.2%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.5%✅⬆️
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 (8118) - mean (79ms)  : 76, 82
    master - mean (78ms)  : 75, 81

    section Bailout
    This PR (8118) - mean (82ms)  : 79, 85
    master - mean (83ms)  : 80, 85

    section CallTarget+Inlining+NGEN
    This PR (8118) - mean (1,118ms)  : 1068, 1168
    master - mean (1,122ms)  : 1057, 1187

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 (8118) - mean (134ms)  : 129, 138
    master - mean (134ms)  : 130, 138

    section Bailout
    This PR (8118) - mean (135ms)  : 132, 139
    master - mean (136ms)  : 132, 139

    section CallTarget+Inlining+NGEN
    This PR (8118) - mean (895ms)  : 850, 940
    master - mean (899ms)  : 855, 942

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8118) - mean (119ms)  : 115, 123
    master - mean (119ms)  : 113, 124

    section Bailout
    This PR (8118) - mean (121ms)  : 119, 123
    master - mean (120ms)  : 117, 122

    section CallTarget+Inlining+NGEN
    This PR (8118) - mean (853ms)  : 814, 892
    master - mean (849ms)  : 821, 878

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8118) - mean (116ms)  : 112, 121
    master - mean (116ms)  : 111, 121

    section Bailout
    This PR (8118) - mean (118ms)  : 115, 121
    master - mean (117ms)  : 112, 121

    section CallTarget+Inlining+NGEN
    This PR (8118) - mean (769ms)  : 749, 789
    master - mean (758ms)  : 734, 782

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 (8118) - mean (210ms)  : 202, 217
    master - mean (203ms)  : 196, 210

    section Bailout
    This PR (8118) - mean (212ms)  : 203, 220
    master - mean (208ms)  : 202, 215

    section CallTarget+Inlining+NGEN
    This PR (8118) - mean (1,197ms)  : 1146, 1249
    master - mean (1,201ms)  : 1134, 1268

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 (8118) - mean (310ms)  : 298, 323
    master - mean (309ms)  : 296, 321

    section Bailout
    This PR (8118) - mean (312ms)  : 299, 325
    master - mean (311ms)  : 302, 321

    section CallTarget+Inlining+NGEN
    This PR (8118) - mean (1,047ms)  : 979, 1115
    master - mean (1,036ms)  : 993, 1078

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8118) - mean (307ms)  : 296, 319
    master - mean (300ms)  : 289, 310

    section Bailout
    This PR (8118) - mean (310ms)  : 295, 324
    master - mean (300ms)  : 291, 310

    section CallTarget+Inlining+NGEN
    This PR (8118) - mean (1,036ms)  : 990, 1082
    master - mean (1,020ms)  : 971, 1070

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8118) - mean (306ms)  : 295, 318
    master - mean (294ms)  : 282, 306

    section Bailout
    This PR (8118) - mean (310ms)  : crit, 291, 328
    master - mean (292ms)  : 285, 300

    section CallTarget+Inlining+NGEN
    This PR (8118) - mean (992ms)  : 875, 1109
    master - mean (944ms)  : 833, 1055

Loading

@pr-commenter
Copy link

pr-commenter bot commented Jan 30, 2026

Benchmarks

Benchmark execution time: 2026-02-04 15:05:01

Comparing candidate commit ba5d881 in PR branch nacho/DiscoveryFlakyTests with baseline commit 6717993 in branch master.

Found 8 performance improvements and 8 performance regressions! Performance is the same for 158 metrics, 18 unstable metrics.

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

  • 🟥 execution_time [+12.324ms; +15.950ms] or [+6.233%; +8.067%]

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

  • 🟥 execution_time [+18.323ms; +18.474ms] or [+10.077%; +10.160%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs netcoreapp3.1

  • 🟥 execution_time [+20.051ms; +20.586ms] or [+10.981%; +11.274%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack netcoreapp3.1

  • 🟥 execution_time [+25.002µs; +54.310µs] or [+7.541%; +16.382%]
  • 🟥 throughput [-363.822op/s; -166.247op/s] or [-12.038%; -5.501%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net6.0

  • 🟩 execution_time [-105.973ms; -105.114ms] or [-52.987%; -52.557%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+20.740ms; +25.603ms] or [+10.701%; +13.209%]

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

  • 🟥 execution_time [+33.535ms; +39.756ms] or [+21.773%; +25.811%]
  • 🟥 throughput [-325.706op/s; -273.175op/s] or [-20.886%; -17.518%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net6.0

  • 🟩 execution_time [-114.676µs; -107.084µs] or [-5.585%; -5.215%]
  • 🟩 throughput [+26.878op/s; +28.717op/s] or [+5.519%; +5.896%]

scenario:Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery net472

  • 🟩 throughput [+22751.797op/s; +24699.609op/s] or [+6.605%; +7.171%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net6.0

  • 🟩 throughput [+2731.969op/s; +4294.497op/s] or [+15.398%; +24.205%]

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

  • 🟩 throughput [+14768891.815op/s; +16125893.300op/s] or [+6.547%; +7.149%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472

  • 🟩 throughput [+52925.210op/s; +56596.387op/s] or [+6.088%; +6.511%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472

  • 🟩 throughput [+33282.934op/s; +36143.898op/s] or [+7.815%; +8.487%]

@NachoEchevarria NachoEchevarria marked this pull request as ready for review February 4, 2026 12:02
@NachoEchevarria NachoEchevarria requested a review from a team as a code owner February 4, 2026 12:02
Copy link
Member

@andrewlock andrewlock left a comment

Choose a reason for hiding this comment

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

Hey, nice idea, but I don't think this will work...

AFAICT, none of the changes in this PR will resolve any flakiness 🤔 We already had mutexes at the appropriate place, this PR just adds an extra mutex in the middle. But given it's always doing mutex2.Wait() immediately before mutex3.Wait(), this won't improve anything I think.

It seems like the issue is more likely some sort of resource exhaustion, as we've been seeing recently generally, and if anything, this may actually make the problem worse as it gives us extra mutexes to wait for 😅

IMO, the biggest thing we could do to reduce the flake is probably revert all this, and just bump up the 10s wait time to be 30s, unless there's something else we're missing here 🤷‍♂️

@NachoEchevarria
Copy link
Collaborator Author

Hey, nice idea, but I don't think this will work...

AFAICT, none of the changes in this PR will resolve any flakiness 🤔 We already had mutexes at the appropriate place, this PR just adds an extra mutex in the middle. But given it's always doing mutex2.Wait() immediately before mutex3.Wait(), this won't improve anything I think.

It seems like the issue is more likely some sort of resource exhaustion, as we've been seeing recently generally, and if anything, this may actually make the problem worse as it gives us extra mutexes to wait for 😅

IMO, the biggest thing we could do to reduce the flake is probably revert all this, and just bump up the 10s wait time to be 30s, unless there's something else we're missing here 🤷‍♂️

Thanks for the feedback!
I have increased the timeouts, hope it will remove flakiness.

Copy link
Member

@andrewlock andrewlock left a comment

Choose a reason for hiding this comment

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

Thanks! (don't forget to update the PR description 🙂 )

@NachoEchevarria NachoEchevarria changed the title Fix Race Condition in DiscoveryService Tests Increase timeout DiscoveryService Tests Feb 4, 2026
@NachoEchevarria NachoEchevarria merged commit e76a1dc into master Feb 4, 2026
142 checks passed
@NachoEchevarria NachoEchevarria deleted the nacho/DiscoveryFlakyTests branch February 4, 2026 17:16
@github-actions github-actions bot added this to the vNext-v3 milestone Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:tests unit tests, integration tests type:flake-fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants