benchmarks: reduce validation timeout to 4s#5797
Conversation
Tighten the expect_in_fork timeout for all validate_benchmarks_spec.rb tests to 4 seconds. Recent observed validation durations on master are below 2.5s (excluding the SymDB baseline_matrix outlier at 6-7s, which is being removed separately). A 4s ceiling is ~2x headroom over the slowest legitimate validation, catching bitrot regressions faster while keeping safe margin. - spec/validate_benchmarks_spec.rb: add explicit timeout_seconds: 4 - spec/datadog/di/validate_benchmarks_spec.rb: 10/20 → 4 (single value, drops the conditional) - spec/datadog/tracing/validate_benchmarks_spec.rb: 20 → 4 - spec/datadog/profiling/validate_benchmarks_spec.rb: 15 → 4 - spec/datadog/error_tracking/validate_benchmarks_spec.rb: add explicit timeout_seconds: 4 - spec/datadog/symbol_database/validate_benchmarks_spec.rb: add explicit timeout_seconds: 4
|
|
Uhhh... be careful with this one. In practice we've seen this be a source of flakiness and this doesn't actually make the tests any slower or faster, since the timeout is never supposed to be hit. I would suggest instead making sure the only-for-validation run of the test itself is faster, since that's what would speed up CI. |
|
SymDB benchmarks were taking 7 seconds to validate which then caused test failures post merge in the validation as well. This PR is intended to verify SymDB benchmarks validate in about the same time as the existing benchmarks (which top out at ~2.7 seconds in the run I looked at). |
What does this PR do?
Tightens
expect_in_fork(timeout_seconds: ...)in everyvalidate_benchmarks_spec.rbto 4 seconds. Six files touched; current values range from no explicit timeout (defaults to 10s in expect_in_fork) up to 20s.Motivation:
Observed validation durations on master @
07e4d7bc92(Unit Tests run 26178282614, Ruby 3.4): max is 2.41s (tracing_trace), with most under 1s. The 10–20s timeouts have ~5–10x headroom — far too loose to catch bitrot quickly. A 4s cap is ~1.5–2x over the slowest legitimate validation, tightens the bitrot signal, and still gives ample margin.symbol_database_baseline_matrixregularly runs 6–8s — but it is being removed in a separate PR (#5795), so it does not need to fit under the new ceiling here. If 5795 lands first there will be no conflict (the SymDB spec file is deleted by 5795); if this PR lands first, the SymDB validation will start timing out — which is the desired signal that the spec needs to go.Change log entry
None.
Additional Notes:
Draft — needs CI to confirm the 4s ceiling holds across all Rubies. Some benchmarks may run slower on Ruby 2.5/2.6 than on 3.4; if any cross 4s on those, the per-benchmark timeout can be selectively raised.
How to test the change?
CI will run the validate specs across the full Ruby matrix. Watch for any
expect_in_forktimeouts and adjust per-benchmark if needed.