Migratet to k8s.io/utils/clock in workqueue

Kubernetes-commit: 392292ba81964e6ee7badec360a800b1f8645f2f
This commit is contained in:
wojtekt
2021-09-09 16:38:59 +02:00
committed by Kubernetes Publisher
parent a5f006eba4
commit 14a51589c3
6 changed files with 18 additions and 18 deletions

View File

@@ -21,7 +21,7 @@ import (
"testing"
"time"
"k8s.io/apimachinery/pkg/util/clock"
testingclock "k8s.io/utils/clock/testing"
)
type testMetrics struct {
@@ -40,7 +40,7 @@ func TestMetricShutdown(t *testing.T) {
m := &testMetrics{
updateCalled: ch,
}
c := clock.NewFakeClock(time.Now())
c := testingclock.NewFakeClock(time.Now())
q := newQueue(c, m, time.Millisecond)
for !c.HasWaiters() {
// Wait for the go routine to call NewTicker()
@@ -170,7 +170,7 @@ func (m *testMetricsProvider) NewRetriesMetric(name string) CounterMetric {
func TestMetrics(t *testing.T) {
mp := testMetricsProvider{}
t0 := time.Unix(0, 0)
c := clock.NewFakeClock(t0)
c := testingclock.NewFakeClock(t0)
mf := queueMetricsFactory{metricsProvider: &mp}
m := mf.newQueueMetrics("test", c)
q := newQueue(c, m, time.Millisecond)