package activator import ( "testing" "time" ) // The wait between health probes starts short, so a fast app is noticed // within milliseconds of binding, and doubles to a ceiling, so a slow one // is not probed in a busy loop. func TestHealthPollBacksOffFromShortToACeiling(t *testing.T) { var got []time.Duration d := time.Duration(0) for range 7 { d = nextHealthPoll(d) got = append(got, d) } want := []time.Duration{5, 10, 20, 40, 50, 50, 50} for i := range want { if got[i] != want[i]*time.Millisecond { t.Fatalf("delays = %v, want %v ms", got, want) } } }