mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 23:47:50 +00:00
Rewritte util.* -> wait.* wherever reasonable
This commit is contained in:
@@ -39,6 +39,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
utiltesting "k8s.io/kubernetes/pkg/util/testing"
|
||||
"k8s.io/kubernetes/pkg/util/wait"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@@ -193,7 +194,7 @@ func TestDeleteFinalStateUnknown(t *testing.T) {
|
||||
if key != expected {
|
||||
t.Errorf("Unexpected sync all for rc %v, expected %v", key, expected)
|
||||
}
|
||||
case <-time.After(util.ForeverTestTimeout):
|
||||
case <-time.After(wait.ForeverTestTimeout):
|
||||
t.Errorf("Processing DeleteFinalStateUnknown took longer than expected")
|
||||
}
|
||||
}
|
||||
@@ -441,14 +442,14 @@ func TestWatchControllers(t *testing.T) {
|
||||
stopCh := make(chan struct{})
|
||||
defer close(stopCh)
|
||||
go manager.rcController.Run(stopCh)
|
||||
go util.Until(manager.worker, 10*time.Millisecond, stopCh)
|
||||
go wait.Until(manager.worker, 10*time.Millisecond, stopCh)
|
||||
|
||||
testControllerSpec.Name = "foo"
|
||||
fakeWatch.Add(&testControllerSpec)
|
||||
|
||||
select {
|
||||
case <-received:
|
||||
case <-time.After(util.ForeverTestTimeout):
|
||||
case <-time.After(wait.ForeverTestTimeout):
|
||||
t.Errorf("Expected 1 call but got 0")
|
||||
}
|
||||
}
|
||||
@@ -484,7 +485,7 @@ func TestWatchPods(t *testing.T) {
|
||||
stopCh := make(chan struct{})
|
||||
defer close(stopCh)
|
||||
go manager.podController.Run(stopCh)
|
||||
go util.Until(manager.worker, 10*time.Millisecond, stopCh)
|
||||
go wait.Until(manager.worker, 10*time.Millisecond, stopCh)
|
||||
|
||||
pods := newPodList(nil, 1, api.PodRunning, testControllerSpec)
|
||||
testPod := pods.Items[0]
|
||||
@@ -493,7 +494,7 @@ func TestWatchPods(t *testing.T) {
|
||||
|
||||
select {
|
||||
case <-received:
|
||||
case <-time.After(util.ForeverTestTimeout):
|
||||
case <-time.After(wait.ForeverTestTimeout):
|
||||
t.Errorf("Expected 1 call but got 0")
|
||||
}
|
||||
}
|
||||
@@ -515,7 +516,7 @@ func TestUpdatePods(t *testing.T) {
|
||||
|
||||
stopCh := make(chan struct{})
|
||||
defer close(stopCh)
|
||||
go util.Until(manager.worker, 10*time.Millisecond, stopCh)
|
||||
go wait.Until(manager.worker, 10*time.Millisecond, stopCh)
|
||||
|
||||
// Put 2 rcs and one pod into the controller's stores
|
||||
testControllerSpec1 := newReplicationController(1)
|
||||
@@ -542,7 +543,7 @@ func TestUpdatePods(t *testing.T) {
|
||||
if !expected.Has(got) {
|
||||
t.Errorf("Expected keys %#v got %v", expected, got)
|
||||
}
|
||||
case <-time.After(util.ForeverTestTimeout):
|
||||
case <-time.After(wait.ForeverTestTimeout):
|
||||
t.Errorf("Expected update notifications for controllers within 100ms each")
|
||||
}
|
||||
}
|
||||
@@ -583,7 +584,7 @@ func TestControllerUpdateRequeue(t *testing.T) {
|
||||
if key != expectedKey {
|
||||
t.Errorf("Expected requeue of controller with key %s got %s", expectedKey, key)
|
||||
}
|
||||
case <-time.After(util.ForeverTestTimeout):
|
||||
case <-time.After(wait.ForeverTestTimeout):
|
||||
manager.queue.ShutDown()
|
||||
t.Errorf("Expected to find an rc in the queue, found none.")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user