Refactor task_timer to allow mocking the timer #884
Labels
discussion
The viability / implementation of the issue is up for debate
feature
Code based project improvement
The class
task_timer
usesstd::chrono::steady_clock
. Currently, in the tests the real time has to elapse which makes running the test suite take much longer than it could because of the tests regarding this component.I propose refactoring
task_timer
to something like:This would allow instantiating the
task_timer
using a mock timer and would allow replacingthis_thread::sleep_for(chrono::seconds(4));
with something along the line oftimer.advance(4);
effectively making all the tests involving timers instant to execute.The text was updated successfully, but these errors were encountered: