Add more Pods and relax skew in E2E spread test

A spreading test is more meaningful with a greater number of Pods. However, we cannot always expect perfect spreading. We accept a skew of 2 for 5*z Pods, where z is the number of zones.

Change-Id: Iab0de06a95974fbfec604f003b550f15db618ebd
This commit is contained in:
Aldo Culquicondor 2020-10-21 14:10:43 -04:00
parent 161df49979
commit 1840fcd4bb

View File

@ -54,11 +54,11 @@ var _ = SIGDescribe("Multi-AZ Clusters", func() {
// TODO: SkipUnlessDefaultScheduler() // Non-default schedulers might not spread
})
ginkgo.It("should spread the pods of a service across zones", func() {
SpreadServiceOrFail(f, (2*zoneCount)+1, imageutils.GetPauseImageName())
SpreadServiceOrFail(f, 5*zoneCount, imageutils.GetPauseImageName())
})
ginkgo.It("should spread the pods of a replication controller across zones", func() {
SpreadRCOrFail(f, int32((2*zoneCount)+1), framework.ServeHostnameImage, []string{"serve-hostname"})
SpreadRCOrFail(f, int32(5*zoneCount), framework.ServeHostnameImage, []string{"serve-hostname"})
})
})
@ -171,7 +171,7 @@ func checkZoneSpreading(c clientset.Interface, pods *v1.PodList, zoneNames []str
maxPodsPerZone = podCount
}
}
gomega.Expect(minPodsPerZone).To(gomega.BeNumerically("~", maxPodsPerZone, 1),
gomega.Expect(maxPodsPerZone-minPodsPerZone).To(gomega.BeNumerically("~", 0, 2),
"Pods were not evenly spread across zones. %d in one zone and %d in another zone",
minPodsPerZone, maxPodsPerZone)
}