mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #20686 from dchen1107/test1
Auto commit by PR queue bot
This commit is contained in:
commit
b0560cba2e
@ -179,6 +179,7 @@ func waitForStableCluster(c *client.Client) int {
|
||||
var _ = Describe("SchedulerPredicates [Serial]", func() {
|
||||
var c *client.Client
|
||||
var nodeList *api.NodeList
|
||||
var systemPodsNo int
|
||||
var totalPodCapacity int64
|
||||
var RCName string
|
||||
var ns string
|
||||
@ -198,6 +199,16 @@ var _ = Describe("SchedulerPredicates [Serial]", func() {
|
||||
c = framework.Client
|
||||
ns = framework.Namespace.Name
|
||||
nodeList = ListSchedulableNodesOrDie(c)
|
||||
|
||||
// Every test case in this suite assumes that cluster add-on pods stay stable and
|
||||
// cannot be run in parallel with any other test that touches Nodes or Pods.
|
||||
// It is so because we need to have precise control on what's running in the cluster.
|
||||
systemPods, err := c.Pods(api.NamespaceSystem).List(api.ListOptions{})
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
systemPodsNo = len(systemPods.Items)
|
||||
|
||||
err = waitForPodsRunningReady(api.NamespaceSystem, systemPodsNo, podReadyBeforeTimeout)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
})
|
||||
|
||||
// This test verifies that max-pods flag works as advertised. It assumes that cluster add-on pods stay stable
|
||||
@ -284,7 +295,7 @@ var _ = Describe("SchedulerPredicates [Serial]", func() {
|
||||
_, found := nodeToCapacityMap[pod.Spec.NodeName]
|
||||
Expect(found).To(Equal(true))
|
||||
if pod.Status.Phase == api.PodRunning {
|
||||
Logf("Pod %v requesting capacity %v on Node %v", pod.Name, getRequestedCPU(pod), pod.Spec.NodeName)
|
||||
Logf("Pod %v requesting resource %v on Node %v", pod.Name, getRequestedCPU(pod), pod.Spec.NodeName)
|
||||
nodeToCapacityMap[pod.Spec.NodeName] -= getRequestedCPU(pod)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user