Networking e2es: Wait for all nodes to be schedulable in kubeproxy and networking tests

Now that GCE routes take an extremely long time to come up and there's
a variance in "Ready" and "Schedulable", start cherry-picking tests
where we really want to have all nodes routable/schedulable for
testing. Adding logging. This will increase test times on large
clusters but should have 0 impact on normal testing.
This commit is contained in:
Zach Loafman
2016-06-07 16:31:05 -07:00
parent 7476d97781
commit 936297c64c
3 changed files with 11 additions and 3 deletions

View File

@@ -2623,7 +2623,7 @@ func GetReadySchedulableNodesOrDie(c *client.Client) (nodes *api.NodeList) {
}
func WaitForAllNodesSchedulable(c *client.Client) error {
return wait.PollImmediate(30*time.Second, 2*time.Hour, func() (bool, error) {
return wait.PollImmediate(30*time.Second, 4*time.Hour, func() (bool, error) {
opts := api.ListOptions{
ResourceVersion: "0",
FieldSelector: fields.Set{"spec.unschedulable": "false"}.AsSelector(),
@@ -2634,11 +2634,16 @@ func WaitForAllNodesSchedulable(c *client.Client) error {
// Ignore the error here - it will be retried.
return false, nil
}
schedulable := 0
for _, node := range nodes.Items {
if !isNodeSchedulable(&node) {
return false, nil
if isNodeSchedulable(&node) {
schedulable++
}
}
if schedulable != len(nodes.Items) {
Logf("%d/%d nodes schedulable (polling after 30s)", schedulable, len(nodes.Items))
return false, nil
}
return true, nil
})
}