06-04-2009 04:03 AM
Hi,
I call a sub sequence in a 'New Thread'. One step inside this sub Sequence fails.
The end result is Test Failed as it is supposed to be but the failed step does not show. (I display only failed steps in the report).
Can it be fixed?
Thanks
Rafi
Solved! Go to Solution.
06-04-2009 04:59 AM
Hi,
I think you need to use a Wait step in you Caller sequence so that the results are passed back.
Regards
Ray Farmer
06-04-2009 09:16 PM
This is correct. If you look at the Execution Entry Point of the Process Model, you will notice that once the Main Sequence has finished execution, report generation and other things start.
If you spawn a sequence in new thread from Main Sequence, then MainSequence could finish before the SubSequence finishes execution and the results of the SubSequence don't propogate back to MainSequence. So as Ray mentioned, you could force the MainSequence to wait for the SubSequence to complete execution using a Wait step.
See attached screenshot and/or example:
06-05-2009 04:34 PM
For completeness:
KnowledgeBase 4Y4F42PE: Why Are the Results of Subsequences Called in New Threads Not Included In My...
Community Example: TestStand: Including Results of Subsequence Launched in New Thread in Report
06-07-2009 03:12 AM
Hi Jervin,
Thank you very much for your detailed answer. Also, thank you for teaching me this new thing about the wait for thread step.
It does do the job, however, I still do not understand something.
As you said (and the articles you mentioned too), the result of the subsequence does not show in the final report since the mainSequence does not wait for that sub seq to complete. THIS IS NOT TRUE. I always synchronize my new threads subsequences. I do it with the 'Event' step. (set event in the new thread, Wait for event in the caller seq). The technique works, the event step waits for the subsequence to complete. Nevertheless, the subsequence steps do not appear in the final report. I checked the resultList after the subsequence is complete (by putting a break after the 'wait for event' step. The information of the subsequence does not appear there. When I added the special 'Wait' step you advice. The information did appear in the report.
Any explanation to that?
Thanks
Rafi
06-08-2009 12:49 AM
Rafi,
I dont fully understand what's going on but its something in the Wait step allows the ResultsList container to be passed on too the sequence that's waiting.
Regards
Ray
06-08-2009 08:01 AM
Rafi,
The key sentence in the first link Jervin sent is "The default report generation will include any result that is included in the MainSequence's ResultList container." Even when you synchronize the subsequence there is no step that copies the subsequence's ResultList to the MainSequence, therefore no step results are reported. However the Wait step automatically accomplishes this copying for you.
If you wanted to you could have a two step process - one to synchronize the subsequence and another to manually copy the ResultList from your subsequence to the MainSequence, but the Wait step does both for you so it is a much nicer solution.
Hope that clears things up a bit more!
06-09-2009 01:16 AM
Thank you all,
Ray, John, Jervin...it is clear now. Thanks
Rafi