From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Multithreaded testing in sequential model and post actions

How do I make a failing step go to cleanup in the sequential model using multithreading?

 

Here is what I'm doing in the main sequence:

 

step 1

step 2

execute sequence A in new thread

step 3

step 4

step 5

wait for execute sequence A to finish

step 6

...

 

If step 4 fails, what I think I want is for the threads to synchronize before proceeding to cleanup, otherwise the cleanup steps might impact sequence A's steps.

 

The "wait for execute sequency A to finish" step can fail, but I think that happens only if one of it's steps fails; step 4 failing won't do it.

 

Maybe I should insert a custom condition expression in the wait  step like

 

 

AnyOf(RunState.SequenceFailed, RunState.ErrorReported)

 

0 Kudos
Message 1 of 3
(3,008 Views)

Hello stephenb2

 

I was thinking that, I mean use the RunState then create a custom condition.

 

That is a good idea

0 Kudos
Message 2 of 3
(2,979 Views)

That worked, although the expression should have been negated for the execute if false case.

 

! AnyOf(RunState.SequenceFailed, RunState.ErrorReported)

Thanks. I just was wondering if I had missed a better approach. 

0 Kudos
Message 3 of 3
(2,969 Views)