Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading