Forum Discussion

larryx's avatar
larryx
Frequent Contributor
12 years ago

[Res]Thread setting in load test scenario

I want to use soapui pro to set up 100-thread load test with below scenario.
step1: start thread1-20
step2: wait 10 sec
step3: start thread21-40
step4: wait 10 sec
step5: start thread41-60
... ...

Does soapui pro support this feature or anyone has such experience? Please Help Me!
Thanks,
Larry

10 Replies

  • larryx's avatar
    larryx
    Frequent Contributor
    Jeshtha,
    Thanks for the suggestion. I tried:
    limit:6
    Threads: 2
    Delay: 5

    Each thread reads a file in my local directory. But I got this error.

    Thanks,
    Larry
  • Hi,

    The error indicates the file not being found. Can you verify that you are not getting this error when you run your TestCase? And if you do a simple strategy of one run of one thread for your LoadTest, do you still get the error?

    Regards,

    Giscard
  • larryx's avatar
    larryx
    Frequent Contributor
    Hi Giscard,
    Sorry for the distraction. I think the error caused by my groovy scripts enable/disable setting.
    However, I tried to write threadIndex ID into log file to confirm if this thread/burst setting picks up uniq file. My setting is below:
    Limit: 6
    Threads: 2
    Strategy: burst
    burst Delay: 5
    Burst Duration: 60

    and get such records in my log file:
    Mon Feb 03 16:39:06 EST 2014thrdIndx= 0 ...j= 0 SE_Text_839.txt
    Mon Feb 03 16:39:06 EST 2014thrdIndx= 1 ...j= 0 SE_Text_840.txt
    Mon Feb 03 16:39:26 EST 2014thrdIndx= 0 ...j= 0 SE_Text_839.txt
    Mon Feb 03 16:39:27 EST 2014thrdIndx= 0 ...j= 0 SE_Text_839.txt
    Mon Feb 03 16:39:28 EST 2014thrdIndx= 0 ...j= 0 SE_Text_839.txt
    Mon Feb 03 16:39:29 EST 2014thrdIndx= 0 ...j= 0 SE_Text_839.txt

    As you can see, the last 4 threads are the same threadIndex and can't pick up uniq file. But I also can pick up uniq file (uniq thrdIndex) from 'Simple' Strategy in load test setting.

    Thanks,
    Larry
  • Hi!

    Could you provide the contents of the Groovy Script that picks up the unique file?
    Also, it would be great if you could elaborate on what is the the expected behavior here? All log entries should refer to a unique file?
    When are you writing to the log file? In the Groovy Script?

    --
    Regards

    Erik
    SmartBear Sweden
  • larryx's avatar
    larryx
    Frequent Contributor
    def thrdIndex = context.ThreadIndex
    j=0


    fileIndex = thrdIndex
    myFileName = list[fileIndex].toString() //get selected filename

    myFile = new File(myFileDir + myFileName)

    toFile = new File(toFileDir + toFileName)
    toFile.append("\r\n "+ now + " ...thrdIndx= "+ thrdIndex + " ...j= "+ j +" "+ myFileName)//write picked up filename into this file

    In my 1st post I mentioned the expected behavior. In the last post, my expected behavior was even more simple.
    1. start threads 1/2
    2. wait 5 sec
    3. Start threads 3/4
    4. wait 5 sec
    5. Start threads 5/6

    Yes, all done in groovy script.

    BTW, my simple strategy log records:
    Mon Feb 03 16:51:26 EST 2014 ...thrdIndx= 1 ...j= 0 SE_Text_846.txt
    Mon Feb 03 16:51:26 EST 2014 ...thrdIndx= 2 ...j= 0 SE_Text_847.txt
    Mon Feb 03 16:51:26 EST 2014 ...thrdIndx= 0 ...j= 0 SE_Text_845.txt

    Thanks,
    Larry
  • Hi!

    But according to this:

    def thrdIndex = context.ThreadIndex
    j=0


    fileIndex = thrdIndex
    myFileName = list[fileIndex].toString() //get selected filename


    There will be a unique file per thread, not by call to the GroovyScript, thus


    Mon Feb 03 16:39:06 EST 2014thrdIndx= 0 ...j= 0 SE_Text_839.txt
    Mon Feb 03 16:39:06 EST 2014thrdIndx= 1 ...j= 0 SE_Text_840.txt
    Mon Feb 03 16:39:26 EST 2014thrdIndx= 0 ...j= 0 SE_Text_839.txt
    Mon Feb 03 16:39:27 EST 2014thrdIndx= 0 ...j= 0 SE_Text_839.txt
    Mon Feb 03 16:39:28 EST 2014thrdIndx= 0 ...j= 0 SE_Text_839.txt
    Mon Feb 03 16:39:29 EST 2014thrdIndx= 0 ...j= 0 SE_Text_839.txt


    is expected since log entry 1 and 3 - 6 all are for the same thread (1) and thus referring to the same file.


    Am I misunderstanding something here?


    --
    Regards

    Erik
    SmartBear Sweden
  • larryx's avatar
    larryx
    Frequent Contributor
    Hi Erik,

    My runtime setting is:
    Limit: 6
    Threads: 2
    Strategy: burst
    burst Delay: 5
    Burst Duration: 60

    According to Jestha's reply on 30 Jan 2014 15:39, I expect to see 6 threads to run in such sequence:
    thrd 1&2
    wait 5 sec
    thrd 3&4
    wait 5 sec
    thrd 5&6

    Each thread runs groovy script (write data into logfile) once, so I should have seen thrdIndex in log file as below:
    Mon Feb 03 16:39:06 EST 2014thrdIndx= 0 ...j= 0 SE_Text_839.txt
    Mon Feb 03 16:39:06 EST 2014thrdIndx= 1 ...j= 0 SE_Text_840.txt
    Mon Feb 03 16:39:26 EST 2014thrdIndx= 2 ...j= 0 SE_Text_841.txt
    Mon Feb 03 16:39:27 EST 2014thrdIndx= 3 ...j= 0 SE_Text_842.txt
    Mon Feb 03 16:39:28 EST 2014thrdIndx= 4 ... ...
    Mon Feb 03 16:39:29 EST 2014thrdIndx= 5 ... ...
  • larryx's avatar
    larryx
    Frequent Contributor
    Shadid,
    Thanks a lot for the info link.
    Larry