cancel
Showing results for 
Search instead for 
Did you mean: 

Multi-threading in SoapUI Mock Service

Highlighted
Occasional Contributor

Multi-threading in SoapUI Mock Service

Hello Friends,

I'm trying to mock a game management system using SoapUI Mock service. I'm concurrently logging multiple players but the requests are failing due to concurrency exception. Does SoapUI handle concurrent users efficiently? Please let me know if there are any options out of the box which I should configure to address these concurrency modification exceptions.

Thanks,
Arun
7 REPLIES 7
Highlighted

Re: Multi-threading in SoapUI Mock Service

Hi Arun,

it should definitely work but you will need to update to the nightly build available at http://www.eviware.com/nightly-builds.

If that doesnt help, can you please post the entire error you are getting?

regards!

/Ole
eviware.com


Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Occasional Contributor

Re: Multi-threading in SoapUI Mock Service

Hi Ole,

Thanks for the quick response. I'm using SoapUI Pro 3.0.1 version. Will these nightly build scripts (I see they are for 3.0.2) work for this version? Please let me know.

Thanks,
Arun
Highlighted

Re: Multi-threading in SoapUI Mock Service

Hi Arun,

yes, you should have no problems upgrading. You can install to a different directory so you have both installations to play with (and compare)..

Let us know how it goes?

regards,

/Ole
eviware.com


Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Occasional Contributor

Re: Multi-threading in SoapUI Mock Service

Hi Ole,

No Luck 

I still get the same exception. Here is the exception message I get in Soap UI


 
   
      Server
      java.util.ConcurrentModificationException
   

 




Based on your suggestion I downloaded "soapUI-Pro-x32-3_0_2.exe" from the nightly build site and installed it and tested the Mock service once again. But still getting the same exception. Is this the patch you are talking about? Or do I need to use any other file from the nightly build folder?

I have also put the code to handle synchronization of threads. But its not working either. Do you have any pointers to this?

Thanks,
Arun
Highlighted

Re: Multi-threading in SoapUI Mock Service

Hi Arun,

can you check the error-log tab in soapUI to see if you are getting any extended information there?

Is there any way I could try to reproduce this? ie could you attach your project file ?

regards,

/Ole
eviware.com


Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Occasional Contributor

Re: Multi-threading in SoapUI Mock Service

Hi Ole,

Here is the complete information on this issue. I have attached the following files which will help you to reproduce the error.

“Gaming Simulator.xml” : SoapUI project document with Mock Service code along with a  test case to test the load

“Message Log of Mock Service.JPG” : This is the exception we are encountering while testing the load on Mock Service.

“Login-Logout Screenshot.JPG”        :          Even though we are using synchronized block of code, multiple threads are executing the synchronized code simultaneously. We have included log.info messages to trace this and as you can see in the bottom of the picture, “Login inside” string is displayed twice continuously which makes it evident that concurrency is not handled properly even through we are using synchronized block of code

"Error Log.txt" : Has the stack trace of the exception we are getting in "error log"

Thank you for your support and any pointers to resolve this issue would be of great help!

Thanks,
Arun
Highlighted

Re: Multi-threading in SoapUI Mock Service

Hello,

Each script will run as a separate Script object, so that synchronization won't work. Instead each script should synchronize on a shared object. Try this instead:

Add a Setup Script to the LoadTest containing this:


context.lock = new Object()


Then, modify your Groovy Script to the following:


//The method itself is not synchronized
def String callLogin()
{
//Use the shared object created in the Setup Script for synchronization
synchronized(context.LoadTestContext.lock)
{
log.info 'Login inside'
...
}
}


This should work as intended. Good luck!

Regards,
Dain
eviware.com


Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
New Here?
Join us and watch the welcome video:
Top Kudoed Authors