Beispiel #1
0
func waitAlarm(c *gc.C, clock *coretesting.Clock) {
	select {
	case <-clock.Alarms():
	case <-time.After(coretesting.LongWait):
		c.Fatalf("timed out waiting for SUT to use clock")
	}
}
Beispiel #2
0
func waitAlarms(c *gc.C, clock *testing.Clock, count int) {
	timeout := time.After(testing.LongWait)
	for i := 0; i < count; i++ {
		select {
		case <-clock.Alarms():
		case <-timeout:
			c.Fatalf("timed out waiting for %dth alarm set", i)
		}
	}
}