mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Merge pull request #25109 from lavalamp/fix-time-sleep
Automatic merge from submit-queue remove inappropriate time.Sleep Fixes #24815 @liggitt since you added this in #8494 :)
This commit is contained in:
commit
9d80a047d2
@ -28,6 +28,7 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/controller/framework"
|
"k8s.io/kubernetes/pkg/controller/framework"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/util/sets"
|
"k8s.io/kubernetes/pkg/util/sets"
|
||||||
|
"k8s.io/kubernetes/pkg/util/wait"
|
||||||
|
|
||||||
"github.com/google/gofuzz"
|
"github.com/google/gofuzz"
|
||||||
)
|
)
|
||||||
@ -223,7 +224,9 @@ func TestHammerController(t *testing.T) {
|
|||||||
go controller.Run(stop)
|
go controller.Run(stop)
|
||||||
|
|
||||||
// Let's wait for the controller to do its initial sync
|
// Let's wait for the controller to do its initial sync
|
||||||
time.Sleep(100 * time.Millisecond)
|
wait.Poll(100*time.Millisecond, wait.ForeverTestTimeout, func() (bool, error) {
|
||||||
|
return controller.HasSynced(), nil
|
||||||
|
})
|
||||||
if !controller.HasSynced() {
|
if !controller.HasSynced() {
|
||||||
t.Errorf("Expected HasSynced() to return true after the initial sync")
|
t.Errorf("Expected HasSynced() to return true after the initial sync")
|
||||||
}
|
}
|
||||||
@ -276,6 +279,7 @@ func TestHammerController(t *testing.T) {
|
|||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|
||||||
// Let's wait for the controller to finish processing the things we just added.
|
// Let's wait for the controller to finish processing the things we just added.
|
||||||
|
// TODO: look in the queue to see how many items need to be processed.
|
||||||
time.Sleep(100 * time.Millisecond)
|
time.Sleep(100 * time.Millisecond)
|
||||||
close(stop)
|
close(stop)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user