Migrate to k8s.io/utils/clock in flowcontrol backoff

Kubernetes-commit: 4ce452989bef21ab6d15bc659f463d8c706ad33e
This commit is contained in:
wojtekt
2021-09-10 09:37:30 +02:00
committed by Kubernetes Publisher
parent 14a51589c3
commit 8d49a0b940
3 changed files with 11 additions and 9 deletions

View File

@@ -20,12 +20,12 @@ import (
"testing"
"time"
"k8s.io/apimachinery/pkg/util/clock"
testingclock "k8s.io/utils/clock/testing"
)
func TestSlowBackoff(t *testing.T) {
id := "_idSlow"
tc := clock.NewFakeClock(time.Now())
tc := testingclock.NewFakeClock(time.Now())
step := time.Second
maxDuration := 50 * step
@@ -51,7 +51,7 @@ func TestSlowBackoff(t *testing.T) {
func TestBackoffReset(t *testing.T) {
id := "_idReset"
tc := clock.NewFakeClock(time.Now())
tc := testingclock.NewFakeClock(time.Now())
step := time.Second
maxDuration := step * 5
b := NewFakeBackOff(step, maxDuration, tc)
@@ -77,7 +77,7 @@ func TestBackoffReset(t *testing.T) {
func TestBackoffHighWaterMark(t *testing.T) {
id := "_idHiWaterMark"
tc := clock.NewFakeClock(time.Now())
tc := testingclock.NewFakeClock(time.Now())
step := time.Second
maxDuration := 5 * step
b := NewFakeBackOff(step, maxDuration, tc)
@@ -99,7 +99,7 @@ func TestBackoffHighWaterMark(t *testing.T) {
func TestBackoffGC(t *testing.T) {
id := "_idGC"
tc := clock.NewFakeClock(time.Now())
tc := testingclock.NewFakeClock(time.Now())
step := time.Second
maxDuration := 5 * step
@@ -127,7 +127,7 @@ func TestBackoffGC(t *testing.T) {
func TestIsInBackOffSinceUpdate(t *testing.T) {
id := "_idIsInBackOffSinceUpdate"
tc := clock.NewFakeClock(time.Now())
tc := testingclock.NewFakeClock(time.Now())
step := time.Second
maxDuration := 10 * step
b := NewFakeBackOff(step, maxDuration, tc)