Currently the tests in util/clock_test.cc tend to be flaky because they they rely on the host machine actually executing the sleeps in a timely manner and not experiencing delays elsewhere.
There's a few things that should probably be done:
Separate out testing basic code functionality (does the code behave sanely) and performance testing (when running an X hz loop, how accurately do we hit the timing)
Adjust test environment to better match real applications (e.g., run processes at higher priorities)
Figure out good ways of measuring performance (e.g., currently we require every single of 100 iterations to be within some tolerance for time accuracy; maybe up that to 1000s of iterations and check that some percentage match our tolerances)
Currently the tests in
util/clock_test.cc
tend to be flaky because they they rely on the host machine actually executing the sleeps in a timely manner and not experiencing delays elsewhere. There's a few things that should probably be done: