Skip to content

Commit

Permalink
remove inappropriate time.Sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
lavalamp committed May 3, 2016
1 parent be21fe7 commit d1de30c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/controller/framework/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"k8s.io/kubernetes/pkg/controller/framework"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util/sets"
"k8s.io/kubernetes/pkg/util/wait"

"github.com/google/gofuzz"
)
Expand Down Expand Up @@ -223,7 +224,9 @@ func TestHammerController(t *testing.T) {
go controller.Run(stop)

// 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() {
t.Errorf("Expected HasSynced() to return true after the initial sync")
}
Expand Down Expand Up @@ -276,6 +279,7 @@ func TestHammerController(t *testing.T) {
wg.Wait()

// 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)
close(stop)

Expand Down

0 comments on commit d1de30c

Please sign in to comment.