Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheduler predicate test explicitly assumes that cluster add-on pods … #20686

Merged
merged 1 commit into from
Feb 10, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 12 additions & 1 deletion test/e2e/scheduler_predicates.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
}
}
Expand Down