Forum Discussion

Santhy's avatar
Santhy
New Contributor
3 years ago
Solved

Test Case should not fails when connection with the server refused

Hi,

I have a test case that will reboot the server. After the reboot call, a soap API call will invoked followed by a groovy script which check whether the API has a response or not(This is to verify whether the server is up or not). But my test case fails due to failed test step(API call) with the following error message

  • "org.apache.http.NoHttpResponseException: The target server failed to respond" or 
  • "org.apache.http.conn.HttpHostConnectException: Connection to http://xxx.xxx.x.xxx refused".

But I want the test case to be success. If I add a delay test step with 1 min delay time it becomes success. I am trying to run the test case with a timeout instead of the delay test step.

 

I have

Enabled the Expect-Continue in the WS-I Settings of SoapUI preferences

Set the Socket timeout to a maximum value in SoapUI preferences    and also

Set the timeout to a maximum value for the failed API request too

 

Can some one help me to solve this issue

 

  • Hi,

     

    It sounds like you got this working with the delay.

     

    The timeouts are for long-running calls, or calls that take too long.  Either based on calling app or a requirement.  E.g. all calls within 10secs.

     

    The timeout won't help in this case as the server is rebooting.  E.g. is not there or refused because the server is still coming up.

     

    The timeout is not a retry until success.

     

    However, you could loop the call until it does return a success though.  At least then you don't have the full minute delay whilst waiting for the reboot.  Only have to wait for as long as it takes the server to come up.

1 Reply

  • ChrisAdams's avatar
    ChrisAdams
    Champion Level 3

    Hi,

     

    It sounds like you got this working with the delay.

     

    The timeouts are for long-running calls, or calls that take too long.  Either based on calling app or a requirement.  E.g. all calls within 10secs.

     

    The timeout won't help in this case as the server is rebooting.  E.g. is not there or refused because the server is still coming up.

     

    The timeout is not a retry until success.

     

    However, you could loop the call until it does return a success though.  At least then you don't have the full minute delay whilst waiting for the reboot.  Only have to wait for as long as it takes the server to come up.