Skip to content

Commit

Permalink
Modify k6 load tests (#5181)
Browse files Browse the repository at this point in the history
* Update the scenarios for k6 tests

* Update the scenarios for k6 tests to run for 3m

* Update the scenarios for k6 tests to run for 5m

* Revert "Re-add the memory leak for testing"

This reverts commit 38f40e8.

* Increase the rate x1.5

* Revert "Revert "Re-add the memory leak for testing""

This reverts commit a239799.

* Increase the rate x2

* Decrease the rate back to 30

* Revert "Revert "Revert "Re-add the memory leak for testing"""

This reverts commit 874fa66.

* Decrease the rate to 10

* Lower the duration to 4 minutes

* Lower the rate to 3

* Lower the VU counts

* Extract the defaultUiState to an object

* Run longer in staging
  • Loading branch information
obulat authored Nov 29, 2024
1 parent 6798610 commit 3a59f9b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/k6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
just k6 ${{ inputs.namespace }} ${{ inputs.scenario }} \
${{ inputs.report && '-o cloud' || ''}} \
-e signing_secret="$K6_SIGNING_SECRET" \
-e scenario_duration="6m" \
-e service_url=${{ inputs.service_url }} \
-e text_summary=/tmp/k6-summary.txt
Expand Down
9 changes: 6 additions & 3 deletions packages/js/k6/src/frontend/scenarios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,17 @@ const createScenario = (
funcName: Action
): Scenario => {
return {
executor: "per-vu-iterations",
executor: "constant-arrival-rate",
env,
exec: funcName,
// k6 CLI flags do not allow override scenario options, so we need to add our own
// Ideally we would use default
// https://community.grafana.com/t/overriding-vus-individual-scenario/98923
vus: parseFloat(__ENV.scenario_vus) || 5,
iterations: parseFloat(__ENV.scenario_iterations) || 40,
timeUnit: __ENV.scenario_time_utin || "1m",
rate: parseInt(__ENV.scenario_rate) || 3,
duration: __ENV.scenario_duration || "4m",
preAllocatedVUs: 10,
maxVUs: 20,
}
}

Expand Down

0 comments on commit 3a59f9b

Please sign in to comment.