Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
K6: Take into account HTTP status code 202 (#1787)
When using `K6_HA_REPLICAS > 1`, Mimir will accept all HTTP calls but a part of those call will receive a status code `202`. The following commit makes this status code as expected otherwise user receive the following error: ``` reads_inat write (file:///.../mimir-k6/load-testing-with-k6.js:254:8(137)) reads_inat native executor=ramping-arrival-rate scenario=writing_metrics source=stacktrace ERRO[0015] GoError: ERR: write failed. Status: 202. Body: replicas did not mach, rejecting sample: replica=replica_1, elected=replica_0 ``` At the end of the benchmark summary display errors: ``` ✗ write worked ↳ 20% — ✓ 23 / ✗ 92 ``` Example of load testing: ```shell ./k6 run load-testing-with-k6.js \ -e K6_SCHEME="https" \ -e K6_WRITE_HOSTNAME="${mimir}" \ -e K6_READ_HOSTNAME="${mimir}" \ -e K6_USERNAME="${user}" \ -e K6_WRITE_TOKEN="${password}" \ -e K6_READ_TOKEN="${password}" \ -e K6_HA_CLUSTERS="1" \ -e K6_HA_REPLICAS="3" \ -e K6_DURATION_MIN="5" ``` Signed-off-by: Wilfried Roset <[email protected]>
- Loading branch information