NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Rendezvous is waiting for a thread but that thread is terminated

Solved!
Go to solution

Capture.PNG

 

I have a pretest sequence which is locked by one thread. If one UUT failes in the pre-test, I need to terminate the execution for the all the sockets using RunState.Engine.TerminateAll() or maybe RunState.GotoCleanup.

 

The problem is that if one UUT fails in the pretest sequence, it is terminated but other threads are waiting for it at the rendezvous.  So the execution is "paused". 

 

When creating the rendezvous I set Number of threads per rendesvouz = RunState.TestSockets.Count. 

 

Is activating the timeout for the rendezvous the only option I have to solve this problem? 

How may I wait for all the threads to finish the pretest and each thread should check if all threads passed the pretest before continuing?

0 Kudos
Message 1 of 2
(2,496 Views)
Solution
Accepted by topic author Heartbeat

Don't use rendezvous for this purpose. I've learned this the hard way. Rendezvous can have a timeout but in my case the timeout would be half an hour. 

If you would like to terminate the execution for all threads if one thread fails in a particular step then do the following: 

 

Share your file globals between all execution. 

Create a string array in file globals. 

set all element to "" in PreBatch. 

In the post-expression of the step which is critical, write 

FileGlobals.CriticalStepResults[RunState.TestSockets.MyIndex] = Step.Result.Status

Later on, in the main section have a Goto or Fn step with the following pre-condition:

Contains(FileGlobals.PreTestResult, "Failed")

In my case, I go to clean up if the above statement is true. 

 

Notes: 

1. If one execution fails in a subsequence it will go to the sub sequences clean up and then the parents clean up. But it will wait at the parents clean up until all other execution reach the parent clean up. 

 

2. I think that the default sections have built in rendezvous. I.e. all threads execute the clean up/set up/main at the same time. If one thread reaches one section before others, it will wait there until all other threads reach that section.

0 Kudos
Message 2 of 2
(2,465 Views)