Rafi -
The purpose of the context is to allow the test to have access to additional information that relates to the test that is currently executing the code module.
In general we recommend to not hold onto a context inside a code module after returning from back to a step that gave the code module the context. If you must, you can hold onto the the engine, but all other information in the context has a specific lifetime where the data is valid. Things like thread, execution, and step, all have a limited lifetime.
During the execution of a single sequence, the context is valid to hold onto, but once the single sequence completes, the context is either released or placed in a cache for later reuse. If you want your code module to handle multiple thr
ead or executions at the same time, holding onto any of this information could lead to incorrect information.
There is not a requirement to pass the sequence context every time and yes your test could hold on to it, but note that you must add a reference to it to hold onto it so that the object reference count in TestStand is managed properly.
Scott Richardson (NI)
Scott Richardson
https://testeract.com