public virtual void TestScheduleDelayedHeartbeat()
 {
     foreach (long now in GetTimestamps())
     {
         BPServiceActor.Scheduler scheduler = MakeMockScheduler(now);
         scheduler.ScheduleNextHeartbeat();
         NUnit.Framework.Assert.IsFalse(scheduler.IsHeartbeatDue(now));
         // Simulate a delayed heartbeat e.g. due to slow processing by NN.
         scheduler.nextHeartbeatTime = now - (HeartbeatIntervalMs * 10);
         scheduler.ScheduleNextHeartbeat();
         // Ensure that the next heartbeat is not due immediately.
         NUnit.Framework.Assert.IsFalse(scheduler.IsHeartbeatDue(now));
     }
 }
 public virtual void TestScheduleHeartbeat()
 {
     foreach (long now in GetTimestamps())
     {
         BPServiceActor.Scheduler scheduler = MakeMockScheduler(now);
         scheduler.ScheduleNextHeartbeat();
         NUnit.Framework.Assert.IsFalse(scheduler.IsHeartbeatDue(now));
         scheduler.ScheduleHeartbeat();
         NUnit.Framework.Assert.IsTrue(scheduler.IsHeartbeatDue(now));
     }
 }