Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
fix IT tests
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmiskiewicz committed Mar 8, 2019
1 parent 60b03b4 commit a8d665d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/integration/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import (
"github.com/kubernetes-incubator/service-catalog/pkg/controller"
scfeatures "github.com/kubernetes-incubator/service-catalog/pkg/features"
"github.com/kubernetes-incubator/service-catalog/test/util"
k8sinformers "k8s.io/client-go/informers"
)

const (
Expand Down Expand Up @@ -762,13 +763,17 @@ func newControllerTestTestController(ct *controllerTest) (
informerFactory := scinformers.NewSharedInformerFactory(catalogClient, 10*time.Second)
serviceCatalogSharedInformers := informerFactory.Servicecatalog().V1beta1()

coreInformerFactory := k8sinformers.NewSharedInformerFactory(fakeKubeClient, time.Minute)
coreInformers := coreInformerFactory.Core()

// WARNING: Should you try to record more events than the buffer size
// passed here, the recording function will hang indefinitely.
fakeRecorder := record.NewFakeRecorder(50)

// create a test controller
testController, err := controller.NewController(
fakeKubeClient,
coreInformers.V1().Secrets(),
catalogClient.ServicecatalogV1beta1(),
serviceCatalogSharedInformers.ClusterServiceBrokers(),
serviceCatalogSharedInformers.ServiceBrokers(),
Expand Down Expand Up @@ -809,9 +814,11 @@ func newControllerTestTestController(ct *controllerTest) (

klog.V(4).Info("Waiting for caches to sync")
informerFactory.Start(stopCh)
coreInformerFactory.Start(stopCh)

klog.V(4).Info("Waiting for caches to sync")
informerFactory.WaitForCacheSync(stopCh)
coreInformerFactory.WaitForCacheSync(stopCh)

controllerStopped := make(chan struct{})

Expand Down

0 comments on commit a8d665d

Please sign in to comment.