Search code examples
jmeterperformance-testingtaurus

Jmeter with Taurus repeatedly use same data set until given hold-for time


I am using this for load testing of my API. I am trying to do a create operation by taking data from a csv file. Here is my yaml file

---
settings:
  proxy:
    ssl-cert: disable
  verbose: true
  env:
    BASE_URI: https://127.0.0.1:8080/api/v2

execution:
- concurrency: 5
  hold-for: 6m
  ramp-up: 30s
  scenario: CreateOperations

scenarios:
  CreateOperations:
    variables:
      jwt_token: ""
    data-sources:
    - path: data.csv
      quoted: true
    headers:
      Content-Type: application/json
    requests:
    - once:
      - label: login
        method: POST
        url: ${BASE_URI}/login
        body:
          user: "user"
          password: "password"
        extract-jsonpath:
          jwt_token:
            jsonpath: $.jwt
      - set-variables:
          jwt_token: ${jwt_token}
    
    - label:  create
    method: POST
    headers:
      Authorization: Bearer ${jwt_token}
    url: ${BASE_URI}/data
    body: ${body}

Here when running the test, data is loading to my API from the CSV file. But when all data are loaded the test is still running until 6 minutes and loading the same data again and again. How can I stop the test execution when all data in CSV file are loaded once? Are there any settings I missed?


Solution

  • Add loop: false to data-sources

    loop allows to loop over in case of end-of-file reached if true, stop thread if false