func waitForClock(c *gc.C, clock *testing.Clock) { select { case <-clock.Alarms(): case <-time.After(coretesting.LongWait): c.Fatal("timed out waiting for clock") } }
func waitAlarm(c *gc.C, clock *jujutesting.Clock) { select { case <-time.After(testing.LongWait): c.Fatalf("alarm never set") case <-clock.Alarms(): } }
// WaitAlarms waits until the supplied clock has sent count values on // its Alarms channel. func WaitAlarms(c *gc.C, clock *testing.Clock, count int) { timeout := time.After(jujutesting.LongWait) for i := 0; i < count; i++ { select { case <-timeout: c.Fatalf("never saw alarm %d", i) case <-clock.Alarms(): } } }
func waitAlarms(c *gc.C, clock *testing.Clock, count int) { timeout := time.After(coretesting.LongWait) for i := 0; i < count; i++ { select { case <-clock.Alarms(): case <-timeout: c.Fatalf("timed out waiting for %dth alarm set", i) } } }