NI TestStand Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Elaine_R.

Allow ProcessModel to obtain/retain MainSequence context before & after Call MainSequence step

Status: New

As someone whom regularly maintains custom process models for my team, there are times when I wish to harvest data from 'any MainSequence run' without requiring my individual developers to remember to set specific custom-parameters or 'runstate.root.* or Locals.ResultList[] values within their test programs correctly every time. 

It would be great if there were hooks, beyond simple parameter passing, that could allow me to dynamically 'reach in' to active execution context of MainSequence ideally 1x at start and end of MainSequence execution (i.e. just after context fabrication, and just before context garbage collection).

In this way, I could use API to monitor data that usually gets garbage collected before the model can 'see' it.

i.e. if I see they have a local variable in their test, Locals.Debugging_Active == true, perhaps I could catch that at the framework level, and update the report header to say 'possibly not production data!',   even if developer forgot to correctly set the 'is Validation Data' flag that is formally available.

In an ideal world we would have strict process & TS style rules to enforce that all developers must set key variables as part of their executions, but also having a scrappy way to catch test-internal context issues within process model (even if this does break the paradigm of immediately garbage collecting sequence specific internal data) would be a great fall-back strategy for teams where they have 1 or 2 test experts and a much larger pool of non-expert test developers using TestStand. 

2 Comments
Elaine_R.
Active Participant

To limit scope of memory preservation, perhaps it could be done for just 1 step, after PreMainSequence callback / before PostMainSequence callback, with a property object similar to Runstate.ProcessModelClient? but instead of containing static file data for the client. it would include execution specific data?


Currently I exploit ProcessModelPostStep to go fishing for 1st or last step 'context' of MainSequence, if I truly need to... but this feels super inefficient 🙂

warren_scott
Active Participant

This is an interesting idea, but hard to implement.  We have also implemented sections of both ProcessModelPreStep and ProcessModelPostStep callbacks that monitor things to keep client code / results / validity in check (at a cost to efficiency)  (so take this comment as a +1 for pain felt).  

I wonder whether there would be a way to get a parallel thread executing that does the monitoring/checking and feeds status back to main thread that is able to stay close enough in sync to be useful but is able to not impact mainline execution performance.  I've been successful with getting parallel monitoring engines running in the past, but it has never been easy and the overhead to manage robustly is difficult.