From 3064fe4d398f41ef03cd44c94d2c56db9d5f72d2 Mon Sep 17 00:00:00 2001 From: Tomas Smetana Date: Fri, 21 Apr 2017 11:08:57 +0200 Subject: [PATCH] Fix issue #44757: Flaky Test_AttachDetachControllerRecovery --- .../volume/attachdetach/attach_detach_controller_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/controller/volume/attachdetach/attach_detach_controller_test.go b/pkg/controller/volume/attachdetach/attach_detach_controller_test.go index a1a2266d651..2fb59027533 100644 --- a/pkg/controller/volume/attachdetach/attach_detach_controller_test.go +++ b/pkg/controller/volume/attachdetach/attach_detach_controller_test.go @@ -168,6 +168,12 @@ func attachDetachRecoveryTestCase(t *testing.T, extraPods1 []*v1.Pod, extraPods2 informerFactory.Start(stopCh) + if !controller.WaitForCacheSync("attach detach", stopCh, + informerFactory.Core().V1().Pods().Informer().HasSynced, + informerFactory.Core().V1().Nodes().Informer().HasSynced) { + t.Fatalf("Error waiting for the informer caches to sync") + } + // Make sure the nodes and pods are in the inforer cache i = 0 nodeList, err := informerFactory.Core().V1().Nodes().Lister().List(labels.Everything())