NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with batch synchronization

Hello,
I've got an issue I'm facing with my sequence (using TestStand 3.0) regarding the one-thread-only batch synchronization.  There are some steps in the Cleanup group of the MainSequence that are grouped together between a call to enter a one-thread-only sync and a call to exit it.  Everything works fine so long as execution on all thread proceeds as usual.  But if an error occurs causing the execution to terminate (or if the user manually terminates the execution) the synchronization section doesn't work.  It looks like the terminated thread stops at the one-thread-only entrance step, but only until another thread hits any other step that involves a batch synchronization setting...
 
Is this behavior expected for some reason?  Or is there any work-around that anyone is aware of for it?  This is a critical issue for me, because a single thread being terminated is causing important shared resources to be released before they should be.
 
Thanks,
Rob
0 Kudos
Message 1 of 6
(4,339 Views)

Hello Rob,

I want to make sure that I understand the problem correctly.   You are using the batch process model, and you have a section of code (a few steps) in your clean-up step group that you only want to run once for each batch.  You are protecting that section of code with an entrance to a batch synchronization and then an exit from a batch synchronization, both using one-thread-only mode.  You also have other sections in your MainSequence that also use a batch synchronization section with different section names.

If an error occurs at a step in MainSequence, TestStand will automatically skip to the clean-up section for that TestSocket.  This TestSocket will wait at the enter batch synchronization section in the clean-up section until any (not all TestSockets) of the remaining TestSockets get to any (not the clean-up) synchronization section.  When this happens, the TestSocket with the error will then enter into the clean-up synchronization section prematurely before the other TestSockets get a chance to get to the clean-up section.  Is this correct?

Does this same behavior happen when you make a smaller sequence file that has a few no-action steps and a few protected synchronization sections?  If so, could you post back and upload that sequence file.  I look forward to hearing back from you!

Best Regards,
Software Engineer
Jett R
0 Kudos
Message 2 of 6
(4,321 Views)

Thanks for the response, JettR.

You have correctly described the problem I'm having.  Let me clarify a couple points.  As it turns out, it doesn't seem to matter whether I enter and exit the synchronized section using the batch sync steps or if I set the properties of the individual steps to run in "one-thread-only" mode.  It also doesn't seem to matter whether I've assigned names to the synchronized sections or not.  One other thing - it doesn't matter if an error occurred - the problem is an execution terminating...  I typically terminate an execution (continue to clean-up) if an error occurs, but this can also be reproduced by manually terminating the execution.  Also, the problem is more than just the terminated execution running the synchronized section before the other executions are ready - the section is actually executed twice.  (Once by the terminated execution, and once by the next execution in line.)

In short, I seems like one potential work-around would be to add some additional code to jump past the cleanup sync section if 1) the execution is terminating and 2) it isn't the only execution running.  But it seems like there should be a better way than that.

I've attached a simple sequence that can be used to reproduce the problem.  If you run it without terminating any threads, everything will behave as expected.  But if you terminate an execution while in the delay in the Main step group, you should see the one-thread-only synchronized step in the cleanup group (a TestStand dialog) get displayed twice.

Let me know if you have any questions.  Thanks.

0 Kudos
Message 3 of 6
(4,316 Views)

Hey Rob,

I tested the sequence file that you uploaded in different versions of TestStand (3.0, 3.1 and 4.0).  I only noticed the behavior you are describing in version 3.0.  It appears that this behavior has been fixed in version 3.1 and later.  Your options at this point are to use the workaround you developed or to upgrade TestStand.  Have a good evening!

Best Regards,
Software Engineer
Jett R
0 Kudos
Message 4 of 6
(4,283 Views)
Is there some good place to find documentation of known bugs in TestStand 3.0 such as this?  (I would've thought the knowledge base would be a good place to look, but it doesn't look like that's very well maintained.  I've never been able to resolve any of my TestStand problems with it.)
0 Kudos
Message 5 of 6
(4,254 Views)
Hey Rob,

I was unable to find any official documentation listing this issues as a reported problem or a fixed problem.  The best place to find this information for any of our products would be the release notes for each version.  The release notes contain the major fixes along with any addition features this release has over the previous version.  You can find the release notes for TestStand Version 3.0 to 4.0 here http://digital.ni.com/public.nsf/allkb/A85813BAE452031F8625734800072721.  I hope this helps, and I am glad you got your work around working.  Have a great holiday season!

Best Regards,
Software Engineer
Jett R
0 Kudos
Message 6 of 6
(4,227 Views)