NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand Failure Chain

Hi,

 

I will check that container Thanks!

 

I have changed a bit the sequence for testing what I need (the step Id of all the chain), I upload it here. My problem now is in the SubSequence call, since the step Pass/fail in it seems not to go any further then a CallStackDepth equal to 2 as SequenceCallThread, which is called in a Separated Thread. By trying some combinations, I have seen that this behaviour is related to the fact that the Wait for thread step is after that Pass/fail. If I move it before the step everything change (in my real sequence I can’t do that unfortunatly). I can’t get why this happens because the threads are separated so I have expected to have a way to understand for each step in which thread it is so that I can compute the correct CallStackDepth for that step.

What am I missing?

 

I hope to be clear in my issue, Thank you for the help!

 

Best Regards,

Zuc

Download All
0 Kudos
Message 11 of 19
(100 Views)

Hi,

 

I don't get exactly the difference between CallStackDepth and CallStackSize and neither the reason why, for avoiding exception and out of index errors, I have to consider the -1 in the computation of the Stack size of MainSequenceCallback thread but not in the one of a sequence called in a separated Thread in the MainSequence, but I have ended up with this sequence that can help someone who is in need like me.

Fell free to ask and suggest ways to improve it!

 

Does anyone have any advise on how to record my variable Locals.IdPath to a MySqlDatabase using teststand? Or is it better to use an external component like a .NET library?

 

Thank you for the help!

Best Regards,

Zuc

Download All
0 Kudos
Message 12 of 19
(88 Views)

Hi,

 

I have to admit, I don't totally understand what you are describing, yet I took a look at your sequence file.

 

You have placed the call stack evaluation into a ProcessModel callback, which is a good idea code-replication-wise. Yet doing so, you are actually changing the context of the call stack evaluation from your client sequence file to the ProcessModel, so your code is not analyzing what you want it to 😉

 

Set breakpoints and you'll see!

0 Kudos
Message 13 of 19
(86 Views)

HI Oli,

 

My doubt is about how TestStand manages the Threads, since if you see the Call Stack tab during the execution the only way to have the ID of the Failed step and the one of the Sequence (which is running in a separated thread) which as called that step is to set the CalStackSize to two (so in the for loop you will run 3 times). But if you do the same for a sequence called in the MainSequence if you use the same confition in the For loop you will encounter an out of bounds error. It seems like you have gone futher in the CallStack array.

I don't get this difference in behaviour in TS, it sees the CallStach as a zero based array or not?

 

"so your code is not analyzing what you want it to" what do you mean with this sentence?

 

Best Regards,

Zuc

0 Kudos
Message 14 of 19
(80 Views)

@Zuc_Lab wrote:

[...]

"so your code is not analyzing what you want it to" what do you mean with this sentence?

 

Best Regards,

Zuc


The point I was trying to make is, that by using the SequenceFilePostStepFailure Engine Callback, IMHO Thread information will vary depending on the ProcessModel used and the number of sockets.

 

Having said that: please allow some time if you want me to dig deeper into this. This is not a thing, I am doing on a regular base 😉

0 Kudos
Message 15 of 19
(64 Views)

Hey Zuc,

 

please check the attached file. I intentionally left some additional code, variables and breakpoints in there for the sake of debugging.

 

To my understanding, this does (most of) the job.

 

If you take a look at the assembled call stack string in the SequenceFilePostStepFailure, you will see, what I meant by "different context": since the code is moved to the Engine Callback, the CallStack has an additional element, but I guess you'll find a way to handle this

 

Cheers

Oli

 

 

0 Kudos
Message 16 of 19
(43 Views)

Hi Oli,

Thank you for your help! I don’t see any breakpoint in the sequence that you have uploaded, but I don’t get what you mean. For me this sequence is equal to the previous one that you have uploaded. I know that the Thread information are related to the socket used and to the model applied to the execution.

What I was asking was the management of the CallStackSize of a sequence in a separated thread.

 

Since for avoiding exception of out of bounds I had to set the stack size like this:

(Locals.ThreadIndex == 0) ? (Locals.MaxLoops = RunState.Execution.GetThread(Locals.ThreadIndex).CallStackSize-1) : (Locals.MaxLoops = RunState.Execution.GetThread(Locals.ThreadIndex).CallStackSize)

 

So if I’m in the MainSequence the CallStacksize need a -1 but in the separated Thread I have to take the full Call Stack Size, Why?

 

Best Regards,

Zuc

0 Kudos
Message 17 of 19
(25 Views)

Hi Zuc,

 

I have downloaded the above file and opened it again. Saw the breakpints, maybe it's a save for previous issue.

 

Let's go through this...

 

Running MainSequence without ProcessModel, I see the following:

Oli_Wachno_0-1714993944535.png

CallStackSize is 0 since MainSequence is called without PreocessModel

 

When running MainSequence with the TestUUTs EntryPoint (I used the BatchModel), I see

 

Oli_Wachno_1-1714994055352.png

CallStack is 1, since MainSequence is called by the SocketEntryPoint. Though I have to admit, I would have expected CallerString to be different. But still not seeing any -1

 

Proceeding into the call of SubSequence (Note: used Run MainSequence for the following)

 

Oli_Wachno_2-1714994301489.png

CallStack Size is now 2 as expected.

 

Proceeding into SubSubSequence, we have the call stack size of 3

Oli_Wachno_3-1714994428618.png

 

 

Now, in the async thread, CallStackSize is 1

Oli_Wachno_4-1714994524640.png

 

For the Engine Callbacks CallStack Depths will change compared to the Sequences, where the errors occur, due to the fact that the CallBack is another SequenceCall

 

So for example for the Callback triggered from

Oli_Wachno_5-1714994796559.png

 

I get the following

 

Oli_Wachno_6-1714994810106.png

 

CallerString is

"/SequenceFilePostStepFailure - Main (Sequence_2021.seq)/SubSequence - Main (Sequence_2021.seq)/Sequence - Main (Sequence_2021.seq)/MainSequence - Main (Sequence_2021.seq)"

 

For the sake of understanding: can you please confirm, that your seeing this also?

 

 

 

0 Kudos
Message 18 of 19
(19 Views)

Hi Oli, 

 

Thank you for helping me in this journey inside TestStand!

 

by -1 i don't intend a value but the -1 that i use in the expression in the sequence i have uploaded:

 

 (Locals.ThreadIndex == 0) ? (Locals.MaxLoops = RunState.Execution.GetThread(Locals.ThreadIndex).CallStackSize-1) : (Locals.MaxLoops = RunState.Execution.GetThread(Locals.ThreadIndex).CallStackSize)

 

For recovering the Full Path of the callers (i launch my sequence with the SequentialModel) i have to add -1 if i'm on the in the same thread of the MainSequence, otherwise i'm on a separated thread and for obtaining the caller path i have to take the full CallStackSize without reducing the ammount of -1. 

 

it is this differences that make me a bit surprised.

 

Is it the same for you?

 

Best regards,

Zuc

0 Kudos
Message 19 of 19
(11 Views)