From 20e8abd28ad7f24d3971686ce52494d23f542c47 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 21 Mar 2019 00:48:30 +0100 Subject: [PATCH] Fix flaky cached discovery test The synchronization handle needs to be called last, to make sure the invalidation handle is called before invoking `lookupNamespaced()` --- cluster/kubernetes/cached_disco_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster/kubernetes/cached_disco_test.go b/cluster/kubernetes/cached_disco_test.go index 82c5dfc6c..d7bf0a74a 100644 --- a/cluster/kubernetes/cached_disco_test.go +++ b/cluster/kubernetes/cached_disco_test.go @@ -65,7 +65,7 @@ func TestCachedDiscovery(t *testing.T) { }, } makeHandler := func(d discovery.CachedDiscoveryInterface) toolscache.ResourceEventHandler { - return chainHandler{first: addHandler, next: makeInvalidatingHandler(d)} + return chainHandler{first: makeInvalidatingHandler(d), next: addHandler} } cachedDisco, store, _ := makeCachedDiscovery(coreClient.Discovery(), crdClient, shutdown, makeHandler)