question

dclaar avatar image
dclaar Suspended asked dclaar Suspended posted

OnTerminalOpenConnectionFail not completing

The default steps for OnTerminalOpenConnectionFail are:

	DeclareExecutionIssue
	FailTest
	AbortExecution

However, that's not what is happening:

   <postProcessingItems>
      <item action="event">
         <description>OnTerminalOpenConnectionFail</description>
         <postProcessingItems>
            <item action="action">
               <description>DeclareExecutionIssue Error:Error attempting to open connection to server: Unable to connect to 10.0.40.72.
Reason:com.maverick.ssh.SshException - Failed to read remote identification [Unknown cause]</description>
            </item>
         </postProcessingItems>
      </item>
      <item action="event">
         <description>OnStepTimeout</description>
         <postProcessingItems>
            <item action="action">
               <description>DeclareExecutionIssue Error:Step has timed out.</description>
            </item>
            <item action="action">
               <description>FailTest</description>
               <postProcessingItems>
                  <item action="event">
                     <description>OnTestResultChange</description>
                  </item>
                  <item action="event">
                     <description>OnFailTestAction</description>
                  </item>
               </postProcessingItems>
            </item>
         </postProcessingItems>

For some reason, it only does the first step. This is annoying, to say the least!

 

iTest 4.0

Version: 4.0.0
Build: 50154

 

iTestbug
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
dclaar avatar image
dclaar Suspended answered dclaar Suspended posted

It may not be obvious from the XML I pasted, but the test didn't abort; it went on and tried to run the rest of the steps.

6 comments
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

koelze avatar image koelze commented ·

Does this happen consistently, or was it just one time?

 

For what it's worth, this is caused by the step timing out at the same time.

0 Likes 0 ·
dclaar avatar image dclaar koelze commented ·

Well, it only happens when the connection is broken. We don't intentionally break the connection as part of any test, so we don't see this often. The intention of this test is to find those broken connections and fix them when our testbed has gone bad; it is essentially a recovery script.

 

The issue is that the SSH thingie hangs, rather than recognizing that there's a problem and closing cleanly, and so the step only stops because of the timeout. Without the timeout, it would be stuck at this step forever. I suppose that I can add an AbortExecution to the timeout event as well, but this did work in 3.4.

0 Likes 0 ·
koelze avatar image koelze dclaar commented ·

Yeah, after I posted that, I figured out how to consistently reproduce it; it'll happen every time with the set of actions you have and the StepTimeout occurs before or at the same time the OnTerminalOpenConnectionFail event does.  In that case, it'll only execute the first action of  the OnTerminalOpenConnectionFail.  That seems like a bug to me; it should either not execute any actions or execute all of them and at least be consistent.

 

I'm surprised that the step doesn't automatically abort ,though, even with no timeout.  Does it not realize the connection hangs and abort with the OnTerminalOpenConnectionFail after 30 seconds?

0 Likes 0 ·
dclaar avatar image dclaar koelze commented ·

Yep, the ssh thingie gets wedged. The wedging also happened in 3.4, see http://forums.fanfaresoftware.com/t5/General-iTest-Topics/maverick-SshException/m-p/10232/highlight/true#M4204. Clearly, there's some state where it is waiting for something to happen, and it never does. As I said, this is a case where the DUT--a linux box running FC2--isn't happy, and I can't readily reproduce that state.

0 Likes 0 ·
koelze avatar image koelze dclaar commented ·

It worked in 3.4?  That's odd, I just booted up 3.4 and see the exact same behavior (see the attached testcase).

0 Likes 0 ·
dclaar avatar image dclaar koelze commented ·

Hmm. I thought it did. Like I said, it doesn't happen that often, so I'm sure that you're correct. Sorry for the misleading comment!

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.