Forum Discussion

Toby_Hage's avatar
Toby_Hage
Occasional Contributor
16 years ago

loadtest not correct when using JDBC MySQL datasource

Hello,

For this question i use the following settings:

threads: 1
strategy: simple
Test Delay: 4000 (ms)
Random: 0.0
Limit: 60 seconds

When there is no datasource, these settings are working correct. So every 4 seconds a request is send to the server for 60 seconds.

When I add a datasource teststep with a datasource loop, the webserver receives 2 or 3 requests per second and the testrun will not finish in 60 seconds.

When i cancel the test the results in the "cnt" column are about 180 (when runned for about 60 seconds, instead of 60/4 = 15)

I have played with datasource options but nothing helps. Is this a bug or did I something wrong?

The datasource is working correct.

Hopefully somebody can help me.

Regards!

5 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Toby,

    The Test Delay is inserted between every run of the TestCase (not a TestStep). In your case the TestCase execution will run the TestCase and loop through the data in your DataSource just as usual; your request using the data will be executed about 180 times (3*60) during this time (once for each row of data). If you want the LoadTest to cancel a running TestCase when the limit has been reached (instead of letting it finish), you need to check the "Cancel Running" option in the LoadTest options dialog.

    Hope this explains a bit, please post again otherwise!

    regards,

    /Ole
    eviware.com
  • Toby_Hage's avatar
    Toby_Hage
    Occasional Contributor
    Hi Ole,

    Thanks for the answer. I understand the cancel running option, it is working correctly. Unfortunately I don't understand the first part :-(

    Maybe you can explain how I can achieve what I want. Hopefully i will then understand what you are meaning.

    What i want is a loadtest that sends every 4 seconds a request to the server. In the testcase there is a datasource teststep, the webservice request and a datasource loop teststep.

    I thought i can manage this with the following settings:
    threads: 1
    strategy: simple
    Test Delay: 4000 (ms)
    Random: 0.0
    Limit: 60 seconds

    But if i understand you correct, these settings are not correct.

    regards,

    Toby.
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Toby!

    if you want a 4 sec delay between each request please insert a Delay step set to 4000ms after (or before) your request in the TestCase, in this way you will get the delay for each row in your datasource.

    regards,

    /Ole
    eviware.com
  • Toby_Hage's avatar
    Toby_Hage
    Occasional Contributor
    Hi Ole and Others,

    Finally I understand what is happening.

    When a datasource is used in a testcase. The testcase will never finish until the datasource is empty. So the test delay is not used in this case during a loadtest. Except between testcase 0 and testcase 1!!

    If you want a delay you can add a teststep with a delay, as mentioned in the previous topic by Ole.

    I thought that the testcase was finished after all teststeps were executed. But the datasource loop will prevent this.

    When I remove the datasource loop, the testcase will finish when all teststeps are exectued. In this case what will happen with the datasource:
    1) same record is used in next testcase execution?
    or
    2) next record is used in next testcase execution?

    regards,

    Toby.