Skip to content

Speed up the timer test

Kenneth Moreland requested to merge kmorel/vtk-m:timer-test-shorter-wait into master

Previously, UnitTestTimer paused for 1 second each time it wanted to test that the timer did (or didn't) record the time elapsing. This was done 3 times per test and tested seperately on (currently) 5 devices. The accumulated 15 seconds is not a whole lot, but it can add up when coupled with the well over 300 other tests.

This change moves from the POSIX sleep function (which is limited to increments of 1 second) to the updated C++ thread/chrono classes. The amount of time to wait each time is now 0.25 seconds, which should speed the test up by 4 times. The risk is that the shorter wait times can throw off the results if the computer being run on is busy. If that is the case, we can bump up the wait time (perhaps to 0.5 seconds).

Merge request reports