Service Virtualization

Expand all | Collapse all

Simulate Perpetual Network Connection

  • 1.  Simulate Perpetual Network Connection

    Posted May 03, 2016 11:48 AM

    Hi All,

    I want to implement the non-functional requirement by simulating a network connection that never times out by holding on the connection for ever. I want to implement HTTP based service can simulate experience a perpetual connection that keeps network connection open for 30 minutes (configurable parameter) and will be timeout after 30 minutes. So any request comes to the virtual service after 30 minutes will respond with error message. Can you please help me with the options.

    Thanks.



  • 2.  Re: Simulate Perpetual Network Connection

    Posted May 03, 2016 12:05 PM

    Can you describe your requirement in more detail?  How is your virtual service going to simulate a connection open for 30 minutes?  The client application initiates the HTTP Connection not the Virtual Service.  i don't believe there would be a concept of DevTest managing a connection that has never been initiated by a client application. 

     

    If you are looking to simulate a connection timeout, you could take a client request and never send a response (e.g., if your request matches some specific criteria, then just loop to the LISTEN step without sending a response).  Due to the virtual service threading model, if one connection stays open, that does not mean that other threads cannot accept HTTP requests.

     

    If you a looking to simulate a server unavailable you could use the same approach and add HTTP 500 or HTTP 503 messages in the HTTP Response headers.

     

    If you stop the service, no HTTP requests will make it to the endpoint.

     

    Please help us understand this further.  Thanks



  • 3.  Re: Simulate Perpetual Network Connection

    Posted May 03, 2016 12:12 PM

    Thanks Joel. I agree with you. We have a same requirement where we want to simulate the service which can simulate connection timeout error after 30 mins of time interval. Do you need to do custom scripting in DevTest to perform such kind of configuration or there are inbuild placeholders present in the tool ?



  • 4.  Re: Simulate Perpetual Network Connection

    Posted May 03, 2016 01:28 PM

    You could try and set up a response in your VSI that has a Think Time of '30m' for 30 minutes. 

    Generally speaking, most client applications wait between 30 seconds and 3 minutes before throwing an HTTP timeout exception.  It sounds like your client application has a really high HTTP Timeout threshold if it holds open an HTTP connection for 30 minutes.   



  • 5.  Re: Simulate Perpetual Network Connection

    Posted May 04, 2016 05:21 PM

    Thanks Joel. I have configured think time for 5 mins in my VSI but whenever I initialed request from client (SOAPUI) I am getting socket timeout exception in 30 seconds. Am I did anything wrong ? Please suggest. Thanks.



  • 6.  Re: Simulate Perpetual Network Connection

    Posted May 04, 2016 05:42 PM

    Keep in mind that the HTTP Connection timeout is also monitored by the client (in this case, SoapUI).   In SoapUI, try looking under Preferences, then HTTP, then look for Socket Timeout.  My guess is that the timeout is set to 30000 ms (i.e., 30 seconds).

     

    Alternatively, you could set up a DevTest Test Case that calls your service.  If you run it in ITR mode, you should get an HTTP Connection timeout. 

     

    I believe the DevTest default HTTP Connection Timeout is 3 minutes or 180000 ms.  You could, perhaps, override this by setting the local.properties lisa.http.timeout.connection=3000000.  This value is expressed in millis.  However, use this setting with caution because lisa.http.timeout.connection is a global DevTest variable that applies to all HTTP (Rest and Soap) client connections.  Setting this value too high is not be advisable as it affects all HTTP connections when DevTest is acting as the client that is submitting the HTTP call.  (For example, any HTTP-based step -- whether in a test case, VSM, or other asset -- is affected by this setting.)



  • 7.  Re: Simulate Perpetual Network Connection

    Posted May 05, 2016 04:23 PM

    Hi Joel, I am still facing same issue. I have configured VSI Think Time to 3 mins and trying to with DevTest testcase but getting timeout error within 1 minute. Even I tried with Execute Script (JSR-223) step where I am using Thread.sleep(180000) to test the scenario but still getting timeout within a minute time.



  • 8.  Re: Simulate Perpetual Network Connection
    Best Answer

    Posted May 05, 2016 09:11 PM

    Hi Aniket, using DevTest 9.1, I created a VSI specific transaction response having a 3 minute response and got it to work correctly.

    I set a transaction's Think time to 3 minutes (3m).

    VSI.JPG

    Then, I deployed the service with 100% Think Scale to ensure the VSE honors the Think Time.

    Deploy.JPG

    I tried a Webservice execution from DevTest and it timed out after approximately 30 seconds. I bumped lisa.http.timeout.connection=18000.  Stopped and started Workstation again, but it timed out at approximately 30 seconds.  Perhaps, Workstation overrode the timeout.  Not sure.

     

    I went to SoapUI and changed the timeout property on my HTTP call to 3 minutes and invoked the service.

    Soap_timeout.JPG

    SoapUI waited for 3 minutes and timed out. 

    Soap_response.JPG

    I then changed SoapUI to wait for 190000 millis (10 seconds longer than my VS 3 minute wait).  Executed same request and got a response at approximately 3 minutes 1 second.

    Timeout_190.JPGResponse.JPG

    So, I would surmise that the service running on my VSE honored the 3 minute delay before sending the response.

    In terms of your configuration, I cannot say why you are not seeing similar results.  I would verifying the VSI think time, make sure that the response that is being sent is the one you set to wait 3 minutes, ensure that your service is running at 100% Think Scale, and retest after setting the SoapUI timeout property based on your test requirement. 

    If you continue to have an issue, your next step would be to open a ticket with CA Support.

    Good Luck, Joel



  • 9.  Re: Simulate Perpetual Network Connection

    Posted May 06, 2016 03:23 PM

    Hi Joel. Its working perfectly as you have mentioned. I will try a Webservice execution from DevTest by overriding lisa.http.timeout.connection property. Thanks for your help !!



  • 10.  Re: Simulate Perpetual Network Connection

    Posted May 06, 2016 04:07 PM

    I never got the DevTest Test case to wait 3 minutes.  


    I was able to get SoapUI to wait 3 minutes.  I configures the service to wait 3m.  And I configures the client (SoapUI) to wait 3 mins.


    I did not have to configure Lisa.http.connection.timeout to accomplish the wait from the VS when using SoapUI.



  • 11.  Re: Simulate Perpetual Network Connection

    Posted May 09, 2016 11:48 AM

    Updated. 

    On the Webservice XML step, you need to increase the timeout (See Transport Tab) in order to make the HTTP call wait longer than 30 seconds. 

    I did not pay attention to the timeout setting on the actual step.  See Call Timeout (ms) under the Transport tab in the graphic below... 

    Callback.JPG



  • 12.  Re: Simulate Perpetual Network Connection

    Posted May 09, 2016 12:52 PM

    Hi Joel, Thanks for an update. I can see Transport tab after enabling advanced options (PRO) of Web Service Execution step.



  • 13.  Re: Simulate Perpetual Network Connection

    Posted May 11, 2016 08:38 AM

    Hi Joel,

     

    I believe we can also increase timeout in the elementary panel for a particular test step.

     

    Regards,

    Mona