Forum Discussion

KevinSmith's avatar
13 years ago

Long running Groovy script

We have a rather long running Groovy script which makes a number of web calls based on various bits of logic. We've set up a test case which runs this using the "Script Runner" component and the "Fixed Rate" component to trigger it. What appears to be our problem is that if the script is triggered before the previous run has finished it's marked as "Failed" (presumably because it never reached the end of the script) i.e. if we set the Fixed Rate component to trigger the script every 5 seconds and the Groovy script takes 20 seconds to execute all runs will be marked as "Failed".

Is there a way for the Groovy script to delay execution of future runs until it's completed? Or is there another way to achieve this?

Apologies if this is obvious but I'm new to both Groovy and LoadUI.

Thanks in advance.
Kevin.

1 Reply

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi!

    Fun to see that you are playing around with the Script Runner

    The Script Runner have no problem handling concurrent requests. My guess would be that there's something in your script that makes it non-concurrent (you might already know this, otherwise I can have a look at it).

    If you go to the settings of the component (the wrench icon) and click advanced, there's a concurrentSamples property that defaults to 100. Set that to 1 instead and the component should never allow concurrent calls to the script.

    Hope this is what you where looking for

    Henrik
    SmartBear Software