Skip to content

fix(loadtest): let a run override a scenario threshold - #1374

Open
TheMeinerLP wants to merge 1 commit into
mainfrom
fix/loadtest-threshold-override
Open

TheMeinerLP wants to merge 1 commit into
mainfrom
fix/loadtest-threshold-override

Conversation

@TheMeinerLP

Copy link
Copy Markdown

Description

Someone who runs the capacity tests wants to ask a narrower question than the default limit allows: "does resolve still hold at 200 ms?" Until now the answer meant editing the shared threshold file, which would then change every run that came after it, not only the one being looked at.

With this change a run takes --threshold <scenario>=<ms> and uses that limit for its own scenario only. The other limits keep their declared values, and the result stays comparable with the runs that used the default. A value that does not make sense is refused before any load is sent, so a typo cannot quietly produce a run with the wrong limit.

The flag is documented next to the other runner options in the load test guide. Closes no issue; it implements the threshold override of the add-load-tests change.

Type of change

  • fix - bug fix
  • feat - new feature
  • refactor - internal change without behaviour change
  • perf - performance improvement
  • docs - documentation only
  • test - tests only
  • build / ci / chore - tooling, dependencies, pipelines
  • Breaking change (configuration, API or behaviour that existing deployments rely on)

How was this tested?

Unit tests first, written red and then made green. They cover that the override applies to the named scenario only, that the plateau verdicts and the breakpoint abort use it, and that a value that is not a positive whole number of milliseconds, an unknown scenario, deploy, a second flag or a scenario other than the run's is refused.

cd loadtest && npx tsc --noEmit        # exit 0
cd loadtest && npx tsx --test "lib/**/*.test.ts" "runner/**/*.test.ts" "scenarios/**/*.test.ts" "profiles/**/*.test.ts" "topologies/**/*.test.ts" "k8s/**/*.test.ts" "grafana/**/*.test.ts"
# tests 347, pass 347, fail 0

No cluster run was started. The Gradle build is not involved, because loadtest/ is a separate TypeScript project.

Checklist

  • Commit messages follow the Conventional Commits convention documented in CLAUDE.md (English, imperative, one of feat, fix, docs, refactor, test, build, ci, chore, perf)
  • Tests cover the change, or the change is not testable and I explained why above
  • ./gradlew build passes locally (not applicable: loadtest/ does not use Gradle; the TypeScript checks are listed above)
  • Documentation and configuration samples are updated if the change is user-facing
  • Existing copyright headers are preserved; new files carry the appropriate header
  • No credentials, tokens or personal data are included in the diff

A plateau step passes only under the p95 limit of its scenario. Those
limits stay provisional until the first measured run sets them, and
changing one meant editing the shared file, which then changed every
later run too. A run now takes --threshold <scenario>=<ms> and uses
that limit for its own scenario only, while the other limits keep
their declared values.

Input that would silently do the wrong thing is refused before any
load is sent: a value that is not a positive whole number of
milliseconds, an unknown scenario, deploy (its limit depends on the
artifact size) and a scenario other than the one the run uses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant