From b4585a7883284fdccf1ed0e9cac721c1eb73c295 Mon Sep 17 00:00:00 2001 From: Jerzy Szczepkowski Date: Tue, 30 Jun 2015 16:57:44 +0200 Subject: [PATCH] Fixed flakiness of e2e reboot test. Fixed flakiness of e2e reboot test caused by restarts of pods with liviness probe during node reboot. Fixes #9062. --- test/e2e/reboot.go | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/test/e2e/reboot.go b/test/e2e/reboot.go index bc09c65a58f..326dbd7bfa9 100644 --- a/test/e2e/reboot.go +++ b/test/e2e/reboot.go @@ -171,11 +171,21 @@ func rebootNode(c *client.Client, provider, name, rebootCmd string, result chan return } - // Get all the pods on the node. + // Get all the pods on the node that don't have liveness probe set. + // Liveness probe may cause restart of a pod during node reboot, and the pod may not be running. pods := ps.List() - podNames := make([]string, len(pods)) - for i, p := range pods { - podNames[i] = p.ObjectMeta.Name + podNames := []string{} + for _, p := range pods { + probe := false + for _, c := range p.Spec.Containers { + if c.LivenessProbe != nil { + probe = true + break + } + } + if !probe { + podNames = append(podNames, p.ObjectMeta.Name) + } } Logf("Node %s has %d pods: %v", name, len(podNames), podNames)