Forum Discussion

Federal_Home_Lo_1's avatar
Federal_Home_Lo_1
Occasional Contributor
14 years ago

Issue running load tests in soapuipro >1 thread

Background:
We have process that uses web services to orchestrate a trade. To test this, we created a test case “GenericAdvanceProcess”. This test case has 16 steps.
Before running this test case we refresh production data to test systems. Once refreshed, we use yesterday’s successful trades (getadvrequest step) and create new trade request (getFinalRate) and pass it refined parameters (using requestParameters step, getProduct, get opics date, tradedate, maturitydate steps). This trade request is sent to our application server.
Our application server would respond back to “updateManualRate1” mock web service step.
This information along with rate request is submitted to our application server (simulating the confirmation step by user).
Our application server then books the trade and finishes by sending a message to “updateAdvance” step.
There is a datasource loop step that goes through the whole process again for the next trade.

This works very well for our functional testing.

Issue:
Before running it as a load test, I disabled the datasource loop step. Load tests work fine in simple strategy with 1 thread, Test delay of 1000, Random=.5, Limit =300 seconds. As soon as I change the number of threads to more than 1 for example 2 threads, the process gets stuck at the updateManualRate1 step. When I looked at the server, I see that the requests to updateManuarRate1 step was successful. However soapui does not proceed to go further than that step.

See attached files (in email) for the logs, the test case project, mock service projects. One interesting thing about the logs is that for 2 threads simple strategy, there is not http / jetty logs. Not sure if this indicates something. Are there any known issues with running load tests for testcases with mock services.

Any help here is much appreciated.

6 Replies

  • Hi,

    For a MockResponse TestStep to work during a LoadTest with more than one thread you need to configure a Query/Match setup for the TestStep (in the corresponding tab under the request/response editors) that is needed internally by soapUI to decide which incoming request that should be routed to which thread - for example if you have some unique identifier from the datasource that is present in the incoming request, set an XPath which selects it from the request and a property-expansion which selects the value from the DataSource - in that way soapUI will be able to associate these correctly.

    Hope this helps!

    /Ole
    SmartBear Software
  • Federal_Home_Lo_1's avatar
    Federal_Home_Lo_1
    Occasional Contributor
    Thanks for the response. I tried doing that on field like status code. The status code is either 0 or 1 depending on success/failure.
    xpath : declare namespace ws='http://ws.advances.pso.s1.com/';
    //ws:updateManualRate[1]/manualRateRq[1]/manualRateStatus[1]

    expected value : 0

    However that may not be enough to uniquely identify and that may be the reason anything over 2 threads started getting stuck. But i am not entirely clear how I can specify the same for unique field. For example the fields that is unique coming in from our server is

    declare namespace ws='http://ws.advances.pso.s1.com/';
    //ws:updateManualRate[1]/manualRateRq[1]/backendReferenceNumber[1]

    Since this field is always has a new unique value, how do I provide the expected value?

    I tried a few things. I guess I am not doing something right.

    Thanks for you help.
  • Federal_Home_Lo_1's avatar
    Federal_Home_Lo_1
    Occasional Contributor
    More Information:

    When I run with 2 concurrent threads: I get the following response from soapui.

    <soapenv:Body>
    <soapenv:Fault>
    <faultcode>Server</faultcode>
    <faultstring>Missing operation for soapAction [updateManualRate] and body element [null] with SOAP Version [SOAP 1.1]</faultstring>
    </soapenv:Fault>
    </soapenv:Body>


    The wire output of the soap request looks fine.

    btw...I have made changes as you recommended to use query/match. I matched to what is coming from the data source on the two mock test operations in the test case. So it appears that query/match the way I have set it up is not helping. Any thoughts on how to debug further?
  • Federal_Home_Lo_1's avatar
    Federal_Home_Lo_1
    Occasional Contributor
    More info...

    From soapui log: It looks like just before the error happens the mock service is stopped. Not sure if it is stopped because of the error...

    Sun Mar 04 20:24:47 EST 2012:INFO:Disabling logs during loadtests
    Sun Mar 04 20:24:49 EST 2012:INFO:Got 11 columns from resultset
    Sun Mar 04 20:24:49 EST 2012:INFO:Mounted WSDL for interface [ManualRateServiceSoapBinding] at [/updateManualRate?WSDL]
    Sun Mar 04 20:24:49 EST 2012:INFO:Started mockService [updateManualRate1] on port [23030] at path [/updateManualRate]
    Sun Mar 04 20:24:49 EST 2012:INFO:Mounted WSDL for interface [UpdateAdvanceServiceSoapBinding] at [/updateAdvanceTxn?WSDL]
    Sun Mar 04 20:24:49 EST 2012:INFO:Started mockService [updateAdvance] on port [22222] at path [/updateAdvanceTxn]
    Sun Mar 04 20:24:49 EST 2012:INFO:Mounted WSDL for interface [ManualRateServiceSoapBinding] at [/updateManualRate?WSDL]
    Sun Mar 04 20:24:49 EST 2012:INFO:Started mockService [updateManualRate1] on port [23030] at path [/updateManualRate]
    Sun Mar 04 20:24:49 EST 2012:INFO:Mounted WSDL for interface [UpdateAdvanceServiceSoapBinding] at [/updateAdvanceTxn?WSDL]
    Sun Mar 04 20:24:49 EST 2012:INFO:Started mockService [updateAdvance] on port [22222] at path [/updateAdvanceTxn]
    Sun Mar 04 20:24:49 EST 2012:INFO:Got 1 columns from resultset
    Sun Mar 04 20:24:49 EST 2012:INFO:Got 1 columns from resultset
    Sun Mar 04 20:24:49 EST 2012:INFO:Got 1 columns from resultset
    Sun Mar 04 20:24:49 EST 2012:INFO:Got 1 columns from resultset
    Sun Mar 04 20:25:07 EST 2012:INFO:Stopped MockService [updateManualRate1] on port [23030]
    Sun Mar 04 20:25:07 EST 2012:ERROR:An error occured [Missing operation for soapAction [updateManualRate] and body element [null] with SOAP Version [SOAP 1.1]], see error log for details
    Sun Mar 04 20:25:07 EST 2012:ERROR:An error occured [WRITER], see error log for details
    Sun Mar 04 20:25:09 EST 2012:INFO:Stopped MockService [updateManualRate1] on port [23030]
    Sun Mar 04 20:25:09 EST 2012:INFO:Stopped MockService [updateAdvance] on port [22222]
    Sun Mar 04 20:25:10 EST 2012:INFO:Mounted WSDL for interface [ManualRateServiceSoapBinding] at [/updateManualRate?WSDL]
    Sun Mar 04 20:25:10 EST 2012:INFO:Started mockService [updateManualRate1] on port [23030] at path [/updateManualRate]
    Sun Mar 04 20:25:10 EST 2012:INFO:Mounted WSDL for interface [UpdateAdvanceServiceSoapBinding] at [/updateAdvanceTxn?WSDL]
    Sun Mar 04 20:25:10 EST 2012:INFO:Started mockService [updateAdvance] on port [22222] at path [/updateAdvanceTxn]
    Sun Mar 04 20:25:10 EST 2012:INFO:Got 1 columns from resultset
    Sun Mar 04 20:25:10 EST 2012:INFO:Got 1 columns from resultset
    Sun Mar 04 20:25:21 EST 2012:INFO:Stopped MockService [updateManualRate1] on port [23030]
    Sun Mar 04 20:25:21 EST 2012:INFO:Stopped MockService [updateAdvance] on port [22222]
    Sun Mar 04 20:25:21 EST 2012:INFO:Enabled logs after loadtests
    Sun Mar 04 20:25:21 EST 2012:INFO:Stopped MockService [updateAdvance] on port [22222]
    Sun Mar 04 20:25:26 EST 2012:ERROR:An error occured [WRITER], see error log for details
    Sun Mar 04 20:25:35 EST 2012:ERROR:An error occured [WRITER], see error log for details
  • Federal_Home_Lo_1's avatar
    Federal_Home_Lo_1
    Occasional Contributor
    Some more information....

    When I run the test once, it seems to work just fine. However when I try to run it in a load test with 2 threads, both threads sent the following response to our server :

    Tue Mar 06 23:08:19 EST 2012:ERROR:com.eviware.soapui.impl.wsdl.mock.DispatchException: Missing operation for soapAction [updateManualRate] and body element [null] with SOAP Version [SOAP 1.1]


    I compared the httpwirelogs on our server between the successful and failure cases. I attached a report related to it. On the right side we have a successful trade and on the left is the failed trade. You would notice in the failed trade we get that soap operation error.

    Hope to hear from you soon...
  • Federal_Home_Lo_1's avatar
    Federal_Home_Lo_1
    Occasional Contributor
    As I look through the code, I am thinking if threading may be an issue with the groovy script? In my project, I have
    1. getFinalRate test step that calls a web service.
    2. Our server responds back with a backendreference number. The result of the web service is parsed to get a reference number for future processing as follows
    // get response property
    def response = testRunner.testCase.getTestStepByName( "getFinalRate" );
    def root = response.getProperty( "response" );

    // parsing
    def node = new groovy.util.XmlParser(false,false).parseText(root.value);
    def accountNumberNode = node["env:Body"]["getFinalRateResponse"]["BackendReferenceNumber"];
    log.info(accountNumberNode.text());
    context.backendNumber = accountNumberNode.text();
    3. As you suggested, I used the backendNumber to query/match the response of the updateManualrateResponse step. (I also went to the mockservice in 1link_manualupdate project and put the same query/match condition.
    xpath query=declare namespace ws='http://ws.advances.pso.s1.com/';
    //ws:updateManualRate[1]/manualRateRq[1]/backendReferenceNumber[1]
    Matching value=${backendNumber}

    I am wondering if the groovy script that parses the response is threadsafe and if the fact that the backendreference numbers are getting mixed may have something to do with this issue?

    Your thoughts?