Skip to content

Commit 5568780

Browse files
authored
Merge pull request kubernetes#133562 from nojnhuh/dra-e2e-slice-controller-flake
DRA: wait for stats to converge in "creates slices" e2e test
2 parents 29e16ff + bf6c86b commit 5568780

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/e2e/dra/dra.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2172,6 +2172,14 @@ var _ = framework.SIGDescribe("node")(framework.WithLabel("DRA"), func() {
21722172
emptySlice := gomega.HaveField("Spec.Devices", gomega.BeEmpty())
21732173
gomega.Eventually(ctx, listSlices).WithTimeout(2 * time.Minute).Should(gomega.HaveField("Items", gomega.HaveExactElements(emptySlice)))
21742174
expectStats = resourceslice.Stats{NumCreates: int64(numSlices) + 1, NumDeletes: int64(numSlices)}
2175+
2176+
// There is a window of time where the ResourceSlice exists and is
2177+
// returned in a list but before that ResourceSlice is accounted for
2178+
// in the controller's stats, consisting mostly of network latency
2179+
// between this test process and the API server. Wait for the stats
2180+
// to converge before asserting there are no further changes.
2181+
gomega.Eventually(ctx, controller.GetStats).WithTimeout(30 * time.Second).Should(gomega.Equal(expectStats))
2182+
21752183
gomega.Consistently(ctx, controller.GetStats).WithTimeout(2 * mutationCacheTTL).Should(gomega.Equal(expectStats))
21762184
})
21772185
})

0 commit comments

Comments
 (0)