The test arms timer for 500 msec and then sleeps 1 second and expects that
the timer would always fire exactly 2 times. However, it has a chance to
legitimately fire only once. This makes the test flaky. Fix the test
reducing sleep time down to 450 msec.
The problem started to show up recently, and I attribute that to
626ea75ed2e9. Before this revision sleep(3) was almost always sleeping
over 1000 msec, now it can sleep exactly 1000 msec.