Fix flaky heartbeat test by ensuring time deadline is hit

Pretty cool! Switched to using IsTrueWithin.