ikeough/Dynamo — pull request #747 by Benglin (2013-11-14 11:29:45+00:00)
Title: Unit test case stabilization: Defect_MAGN_159/164

Background
==========
- **It is optional** to accept this pull request (depending if test cases 159/164 continue to fail)

As command framework plays back the commands, the view gets destroyed **10ms** after the last command is played back. This leaves very little time for Dynamo's background thread (**EvaluationThread** in auto-run mode) to produce result of computation. It appears that if these two tests (Defect_MAGN_159/164) are placed at the very beginning of **RecordedTests** test suite (due to their names in alphabetical order), then they tend to fail. And since 159 is placed before 164, it is a lot more likely to fail as compared to 164.

Possible fixes
==============
Even though it is possible to configure the shutdown time for each test case by altering the value of **PauseAfterPlaybackInMs** in recorded command XML file to a higher value, it has the effect of accumulating if most command XML increase the value. That results in longer overall unit test duration.

This solution attempts to add a constant upfront delay by having **_SnowPeashooter** test case which shuts down after 2 seconds, giving enough time for the system (Dynamo runtime) to "warm up", before proceeding to execute the next test case **Defect_MAGN_159**.

For observation
===============
This seems to be working on ChocoButterUI from the look of it, but we won't know until we see more build results in near future. So the **ShowPeashooter** is just an experimental build fix that may or may not be feasible. If it is not helping for some scenario (where the test machine is heavily taxed), then we will fallback to using **PauseAfterPlaybackInMs** in those failing XML.