From 492d22972b3d229e228c6249a260b4a5bd4d8d0a Mon Sep 17 00:00:00 2001 From: Satnam Singh Date: Fri, 12 Jun 2015 11:30:54 -0700 Subject: [PATCH] Make Elasticsearch logging test check for node failures --- test/e2e/es_cluster_logging.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/e2e/es_cluster_logging.go b/test/e2e/es_cluster_logging.go index 20566e4fd2..1dc4f49ed2 100644 --- a/test/e2e/es_cluster_logging.go +++ b/test/e2e/es_cluster_logging.go @@ -164,6 +164,18 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) { if nodeCount == 0 { Failf("Failed to find any nodes") } + Logf("Found %d nodes.", len(nodes.Items)) + + // Filter out unhealthy nodes. + // Previous tests may have cause failures of some nodes. Let's skip + // 'Not Ready' nodes, just in case (there is no need to fail the test). + filterNodes(nodes, func(node api.Node) bool { + return isNodeReadySetAsExpected(&node, true) + }) + if len(nodes.Items) < 2 { + Failf("Less than two nodes were found Ready.") + } + Logf("Found %d healthy nodes.", len(nodes.Items)) // Create a unique root name for the resources in this test to permit // parallel executions of this test.