From fd3dcabf72d9e0c55ee5cb4fdec65e39ce183392 Mon Sep 17 00:00:00 2001 From: gmarek Date: Wed, 30 Dec 2015 09:38:14 +0100 Subject: [PATCH] Remove node status checking spam from tests --- test/e2e/util.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/test/e2e/util.go b/test/e2e/util.go index 8ed47b77043..543ad70fd9a 100644 --- a/test/e2e/util.go +++ b/test/e2e/util.go @@ -2266,16 +2266,19 @@ func waitForNodeToBeNotReady(c *client.Client, name string, timeout time.Duratio func isNodeConditionSetAsExpected(node *api.Node, conditionType api.NodeConditionType, wantTrue bool) bool { // Check the node readiness condition (logging all). - for i, cond := range node.Status.Conditions { - Logf("Node %s condition %d/%d: type: %v, status: %v, reason: %q, message: %q, last transition time: %v", - node.Name, i+1, len(node.Status.Conditions), cond.Type, cond.Status, - cond.Reason, cond.Message, cond.LastTransitionTime) + for _, cond := range node.Status.Conditions { // Ensure that the condition type and the status matches as desired. - if cond.Type == conditionType && (cond.Status == api.ConditionTrue) == wantTrue { - Logf("Successfully found condition %s of node %s to be %t", conditionType, node.Name, wantTrue) - return true + if cond.Type == conditionType { + if (cond.Status == api.ConditionTrue) == wantTrue { + return true + } else { + Logf("Condition %s of node %s is %v instead of %t. Reason: %v, message: %v", + conditionType, node.Name, cond.Status == api.ConditionTrue, wantTrue, cond.Reason, cond.Message) + return false + } } } + Logf("Couldn't find condition %v on node %v", conditionType, node.Name) return false }