From a259a75115150bbc5c6bf4625222d55d363e0209 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Fri, 19 Jul 2024 13:15:56 +0200 Subject: [PATCH] fixup! DRA scheduler: adapt to v1alpha3 API Relax checking of results: the order does not matter. This also avoids https://github.com/onsi/gomega/issues/771 --- .../structured/allocator_test.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/staging/src/k8s.io/dynamic-resource-allocation/structured/allocator_test.go b/staging/src/k8s.io/dynamic-resource-allocation/structured/allocator_test.go index 0f2439f54a31a..782ee3f5b40f3 100644 --- a/staging/src/k8s.io/dynamic-resource-allocation/structured/allocator_test.go +++ b/staging/src/k8s.io/dynamic-resource-allocation/structured/allocator_test.go @@ -921,12 +921,7 @@ func TestAllocator(t *testing.T) { matchError = gomega.Not(gomega.HaveOccurred()) } g.Expect(err).To(matchError) - matchResults := gomega.HaveExactElements(tc.expectResults...) - if len(tc.expectResults) == 0 { - // Workaround for https://github.com/onsi/gomega/issues/771. - matchResults = gomega.BeEmpty() - } - g.Expect(results).To(matchResults) + g.Expect(results).To(gomega.ConsistOf(tc.expectResults...)) // Objects that the allocator had access to should not have been modified. g.Expect(toAllocate.claims).To(gomega.HaveExactElements(tc.claimsToAllocate))