Merge pull request #133562 from nojnhuh/dra-e2e-slice-controller-flake

DRA: wait for stats to converge in "creates slices" e2e test
This commit is contained in:
Kubernetes Prow Robot
2025-08-19 04:21:36 -07:00
committed by GitHub

View File

@@ -2172,6 +2172,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))
})
})