From bab2dad2341b8e18d31327cde844d6ad34337303 Mon Sep 17 00:00:00 2001 From: Joel Speed Date: Wed, 3 Apr 2019 11:28:50 +0100 Subject: [PATCH] Account for regular cache and multinamespaced cache in List GVK test --- pkg/cache/cache_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/cache/cache_test.go b/pkg/cache/cache_test.go index 2e896a99fa..4a7f5de4ca 100644 --- a/pkg/cache/cache_test.go +++ b/pkg/cache/cache_test.go @@ -200,13 +200,13 @@ func CacheTest(createCacheFunc func(config *rest.Config, opts cache.Options) (ca It("should be able to list objects with GVK populated", func() { By("listing pods") - listObj := &kcorev1.PodList{} - Expect(informerCache.List(context.Background(), listObj)).To(Succeed()) + out := &kcorev1.PodList{} + Expect(informerCache.List(context.Background(), out)).To(Succeed()) By("verifying that the returned pods have GVK populated") - Expect(listObj.Items).NotTo(BeEmpty()) - Expect(listObj.Items).Should(HaveLen(3)) - for _, p := range listObj.Items { + Expect(out.Items).NotTo(BeEmpty()) + Expect(out.Items).Should(SatisfyAny(HaveLen(3), HaveLen(4))) + for _, p := range out.Items { Expect(p.GroupVersionKind()).To(Equal(kcorev1.SchemeGroupVersion.WithKind("Pod"))) } })