Repository navigation
MOD-18184 Gate benchmarks on committed KPI baselines - #1638
Merged
Merged
Conversation
Each tests/benchmarks/<test>.yml can now carry its performance baseline as a
redisbench-admin `kpis` floor:
kpis:
- ge:
"$.Tests.Overall.rps": 194750.47
redisbench-admin already checks those floors at the end of every run
(results_dict_kpi_check -> non-zero exit), so no separate comparison step is
needed -- every lane that runs the benchmarks gates on them: the
`run-benchmark` PR label, pushes to master/feature-*/X.Y, and the nightly.
(`redisbench-admin compare`, which the flow already ran, cannot serve as the
gate: cli.py discards its return value, so it never fails a job.)
The run step in benchmark-flow.yml dropped `continue-on-error: true`; it was
swallowing the exit code, which would have made the gate decorative. Note this
also means remote provisioning failures now fail the job rather than passing
silently.
Baselines are never written by CI. Each group uploads its result json files as
a benchmark-results-<group> artifact, and raising a floor is proposed out of
band from the nightly analysis: update_kpis.py applied to a faster run's own
numbers, opened as a PR for review. The script can only raise a floor, to
measured * (1 - margin), so a slower run proposes nothing (it has already
failed) and a baseline cannot drift downwards on its own -- lowering one is
always a hand edit in a reviewed PR.
The benchmark job is also added to the nightly, including its test-summary
needs and job-failures string, so a red baseline gate is named in the Slack
summary instead of being visible only by drilling into the Actions run.
Floors are intentionally not seeded here -- that needs measured values from a
real run.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1638 +/- ##
=======================================
Coverage 85.97% 85.97%
=======================================
Files 15 15
Lines 5306 5306
=======================================
Hits 4562 4562
Misses 744 744 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
A first seeding run against real results showed two problems. One of the 43 benchmarks (json_recursive_descent_with_filter_uid_issue674) uses memtier_benchmark rather than redis-benchmark, so its result json carries the throughput under "ALL STATS".Totals."Ops/sec" instead of Tests.Overall.rps. Both paths are already among the comparison metrics in defaults.yml; the script now probes for either and writes the floor under whichever one the result actually carries. The memtier jsonpath contains double quotes, so its YAML key is single-quoted. A result file it could not read a throughput from also aborted the whole run part-way through, leaving some baselines seeded and the rest untouched. Such a result is now reported and skipped, with a non-zero exit at the end, so a gap is visible rather than silently mistaken for a baseline that was already high enough. A benchmark the run simply did not cover stays silent, as before. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
redis-benchmark exits 1 on this test with only a CSV header and a zero second duration, and has done since at least the 2026-08-09 master run -- silently, because this step carried continue-on-error: true until this branch removed it. Left in, it would redden every benchmark run, which defeats the point of the gate: a real regression elsewhere would be indistinguishable from this standing failure. run-remote filters on the yml filename, so a negative lookahead drops just this one and keeps the other 42. The underlying failure is untouched and still needs its own fix; while excluded the test produces no data at all, so it is noted in tests/benchmarks/Readme.md rather than left to rot unnoticed a second time. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Removing continue-on-error made the run step's failure real, which had three knock-on effects the original commit missed: - The matrix in benchmark-runner.yml used the default fail-fast: true, so one group failing its KPI floor would cancel the other two and lose their results. Both matrices now set fail-fast: false; the gate is per-benchmark, so the other groups' numbers are still wanted. (Run 34947609292 got away with this only because groups 1 and 3 had already finished when group 2 failed.) - `Generate Pull Request Performance info` keyed on a bare `github.event.number`, which GitHub implicitly treats as `success() && ...` -- so the comparison comment was skipped exactly on the PRs that breached a floor. Now `always() && github.event.number`. - The result artifact was named per member id only, but the profiler matrix reuses ids 1-3 in the same run and upload-artifact@v4 requires unique names, so a run_profiler dispatch would fail the upload. triggering_env now disambiguates. Two further fixes: - The nightly benchmark job ran on every trigger including push, duplicating what event-push-to-integ.yml already does on the same pushes -- six EC2 instances instead of three, with test-summary skipped on push so the extra run reported nowhere. Restricted to non-push events. - update_kpis.py matched results with '*-<name>-*.json', but the filename joins branch and test name with the same separator, so a branch containing a benchmark name could bind the wrong result. The deployment type always follows the test name and always starts "oss-", so the pattern requires that too. Re-verified against all 42 real result files: same floors as before. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…status Reverts the --test-regex exclusion. The standing failure (MOD-18654) is accepted, so the test keeps running and the benchmark job is simply red on every run until it is fixed. The consequence is that job status no longer distinguishes a breached performance baseline from that known failure, so the distinction moves to the log: "Condition on <metric> <measured> ge <floor> is False" -> regression "Failed to run remote benchmark for test '...'" -> MOD-18654 This does not weaken data collection: run-remote gets no --fail_fast and the runner matrix is fail-fast: false, so all 42 other benchmarks still run, still report, and still upload their results from a red run. json_nummultby_num_2 has no floor of its own, so it cannot trigger a false regression either. Documented in tests/benchmarks/Readme.md and in the analyze-nightly Phase 2C workflow, where the baseline-bump step now keys off "no floor breached in the log" rather than "job green" -- which would otherwise never be reached. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
AvivDavid23
reviewed
Sep 15, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8acd225. Configure here.
Both from @AvivDavid23's review on #1638. The repo already uses actions/upload-artifact@v6 in six other places; the new upload step was the odd @v4 out. The benchmarks doc is renamed with git mv so history follows, and the reference to it in event-nightly.yml is updated. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
AvivDavid23
approved these changes
Sep 15, 2026
LiranAbir
added a commit
that referenced
this pull request
Sep 27, 2026
Ten nights of nightlies (09-17 to 09-26) span two commits and produced breach counts of 1, 0, 8, 0, 12, 4, 3, 9, 1, 15 -- a different set of benchmarks each night, one of them swinging 38% between consecutive runs, and a three-night dip that recovered fully on its own. A red benchmark job therefore carries no information about RedisJSON, and the floors are not the cause either: nothing seeded below ~46k rps has breached on any of the ten nights, while everything above ~95k has. So the lane is set aside until the harness's run-to-run variance is understood (MOD-18823), rather than kept red nightly or worked around by lowering floors -- the latter was proposed and closed Won't Do on MOD-18888 after two more nights exceeded three of the four floors it wanted to lower. Scope is exactly what MOD-18184 added in #1638: the nightly job. The push-to-integ, weekly and run-benchmark-label lanes date from 2023 and are untouched, so benchmarks can still be run on demand and the RedisTimeSeries/Grafana series keeps filling from the push lane. The job is left wired into test-summary's `needs` and `job-failures`: a skipped job resolves immediately and reports `skipped` rather than `failure`, so the nightly summary is unaffected and re-enabling is one line.
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.

MOD-18184 — follow-up to MOD-17912 (
get_indexregression), which we had no CI gate to catch.What this does
Lets each
tests/benchmarks/<test>.ymlcarry its own performance baseline as a redisbench-adminkpisfloor:No comparison code was needed — redisbench-admin already checks those floors at the end of every run (
results_dict_kpi_check→return_code |= 1→run_remote.pyexit(return_code)). Verified against the installed package: a run above the floor returns 0, a run below returns 1.That means every lane which already runs the benchmarks now gates on the baseline: the
run-benchmarkPR label, pushes tomaster/feature-*/X.Y, and the nightly.Worth noting for reviewers:
redisbench-admin compare, which this flow already ran, cannot serve as the gate —cli.pydiscards its return value, so it never fails a job regardless of how many regressions it prints.Changes
benchmark-flow.yml— droppedcontinue-on-error: truefrom the run step. It was swallowing the exit code, which would have left the gate decorative. Added an upload of each group's result json files as abenchmark-results-<group>artifact (30 day retention).event-nightly.yml— added thebenchmarkjob, and wired it intotest-summary'sneedsandjob-failuresstring so a red baseline gate is named in the Slack summary instead of being visible only by drilling into the Actions run. (memory-nightly-reporthas the same gap today; left alone as out of scope.)tests/benchmarks/update_kpis.py— new. Reads the result json files a run leaves behind and raises each floor tomeasured * (1 - margin)(5% default). It can only raise: a slower run proposes nothing, so a baseline cannot drift downwards on its own, and lowering one is always a hand edit in a reviewed PR.--self-testcovers raise / never-lower / no-duplicate-block.tests/benchmarks/Readme.md— documents the floors and the promotion flow.Baseline promotion
Baselines are never written by CI. A faster-than-baseline nightly is picked up by the nightly analysis, which runs
update_kpis.pyagainst that run's own numbers and opens a PR with the raised floors. A human merges it; leaving it unmerged keeps the current baselines.Not in this PR
Floors are intentionally not seeded — that needs measured values from a real run, and inventing numbers would give a meaningless gate. Until the first seeding PR merges, the gate is inert but harmless. The 5% margin is a starting point borrowed from
redisbench-admin compare's own regression waterline; it should be revisited against the real run-to-run spread on the CI benchmarks dashboard once floors exist.Risk
Dropping
continue-on-erroralso means remote EC2/provisioning flake now reddens the job rather than passing silently. That is the intent of a gate, but it is a visible behavior change on three lanes.🤖 Generated with Claude Code
Note
Medium Risk
Benchmark jobs can now fail merges and nightlies on KPI breaches or EC2 flakes; nightly Slack will report benchmark failures, and the known MOD-18654 benchmark may mask regression signal in job status alone.
Overview
Enforces committed benchmark KPI floors in CI by letting
redisbench-admin run-remotefail the workflow when throughput drops below each test’skpisfloor, instead of swallowing errors withcontinue-on-error.In
benchmark-flow.yml, remote runs now fail the job on KPI breach; benchmark result JSON is uploaded as artifacts (for baseline bumps); and the PR performance comment runs withalways()so it still posts when the run step fails.benchmark-runner.ymlsets matrixfail-fast: falseso one shard’s failure does not cancel the rest of the suite.Nightly (
event-nightly.yml) adds abenchmarkjob (skipped on push to avoid duplicate EC2 runs) and includes benchmark failures in the Slacktest-summaryjob-failuresstring.Adds
tests/benchmarks/update_kpis.pyto raise YAML floors from result JSON (measured × (1 − margin), never lowering) and replacesReadme.mdwithREADME.mddocumenting baselines, promotion flow, and thatjson_nummultby_num_2(MOD-18654) keeps the job red until fixed—regressions vs that error must be read from logs.Reviewed by Cursor Bugbot for commit c669f88. Bugbot is set up for automated code reviews on this repo. Configure here.