test(benchmarks): cover the CurrentSpeedBenchmark performance gate#134
Merged
Conversation
evaluatePerformanceGate is the only benchmark check that actually fails a run (smoke-profile absolute thresholds on avg latency + peak heap), and it had no test. CurrentSpeedBenchmarkPerfGateTest drives it with synthetic LatencyRow values so the verdict is deterministic and machine-independent: pass within thresholds, fail on avg breach, fail on heap breach, multi-scenario failure aggregation, gate skipped for non-smoke profiles, scenarios without a threshold ignored, and the per-scenario system-property override honored. evaluatePerformanceGate is now static package-private (no instance state) and LatencyRow / PerformanceGateResult / BenchmarkProfile are package-private so the same-package test can build inputs and assert the verdict.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the missing test for
CurrentSpeedBenchmark#evaluatePerformanceGate— the only benchmark check that actually fails a run. It enforces the smoke-profile absolute thresholds (avg latency + peak heap per scenario); previously it had zero coverage.What's covered
CurrentSpeedBenchmarkPerfGateTestdrives the gate with syntheticLatencyRowvalues, so the verdict is deterministic and machine-independent (the gate is not run against real measurements, which would be flaky):graphcompose.benchmark.gate.<scenario>.maxAvgMillisoverrideProduction change
Minimal test seam only — no behaviour change:
evaluatePerformanceGate->staticpackage-private (it uses no instance state)LatencyRow,PerformanceGateResult,BenchmarkProfile-> package-privateso the same-package test can build inputs and read the verdict (same pattern as the existing
BenchmarkDiffTool.ResolvedRunPairseam).Verification
./mvnw -f benchmarks/pom.xml test-> 11/11 green (7 new perf-gate + 2 selection + 2 median); the new class runs in ~30 ms.Note
Independent of #133 (different file:
CurrentSpeedBenchmarkvsBenchmarkDiffTool); both targetdevelopand do not overlap.