From bf6c86b562d3328aa8badd17c7d3077e65e1d1e1 Mon Sep 17 00:00:00 2001 From: Jon Huhn Date: Fri, 15 Aug 2025 01:00:40 -0500 Subject: [PATCH] DRA: wait for stats to converge in "creates slices" e2e test --- test/e2e/dra/dra.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/e2e/dra/dra.go b/test/e2e/dra/dra.go index 5dfd2e14cd3..10407f1a865 100644 --- a/test/e2e/dra/dra.go +++ b/test/e2e/dra/dra.go @@ -2167,6 +2167,14 @@ var _ = framework.SIGDescribe("node")(framework.WithLabel("DRA"), func() { emptySlice := gomega.HaveField("Spec.Devices", gomega.BeEmpty()) gomega.Eventually(ctx, listSlices).WithTimeout(2 * time.Minute).Should(gomega.HaveField("Items", gomega.HaveExactElements(emptySlice))) expectStats = resourceslice.Stats{NumCreates: int64(numSlices) + 1, NumDeletes: int64(numSlices)} + + // There is a window of time where the ResourceSlice exists and is + // returned in a list but before that ResourceSlice is accounted for + // in the controller's stats, consisting mostly of network latency + // between this test process and the API server. Wait for the stats + // to converge before asserting there are no further changes. + gomega.Eventually(ctx, controller.GetStats).WithTimeout(30 * time.Second).Should(gomega.Equal(expectStats)) + gomega.Consistently(ctx, controller.GetStats).WithTimeout(2 * mutationCacheTTL).Should(gomega.Equal(expectStats)) }) })