fix kubectl taint e2e flake: add retries for removing taint

This commit is contained in:
Kevin 2016-09-30 16:14:24 +08:00
parent b71def750f
commit b8b92a1116

View File

@ -1293,7 +1293,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
By("adding the taint " + testTaint.ToString() + " to a node")
runKubectlRetryOrDie("taint", "nodes", nodeName, testTaint.ToString())
By("verifying the node has the taint " + testTaint.ToString())
output := framework.RunKubectlOrDie("describe", "node", nodeName)
output := runKubectlRetryOrDie("describe", "node", nodeName)
requiredStrings := [][]string{
{"Name:", nodeName},
{"Taints:"},
@ -1304,7 +1304,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
By("removing the taint " + testTaint.ToString() + " of a node")
runKubectlRetryOrDie("taint", "nodes", nodeName, testTaint.Key+":"+string(testTaint.Effect)+"-")
By("verifying the node doesn't have the taint " + testTaint.Key)
output = framework.RunKubectlOrDie("describe", "node", nodeName)
output = runKubectlRetryOrDie("describe", "node", nodeName)
if strings.Contains(output, testTaint.Key) {
framework.Failf("Failed removing taint " + testTaint.Key + " of the node " + nodeName)
}
@ -1325,7 +1325,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
By("adding the taint " + testTaint.ToString() + " to a node")
runKubectlRetryOrDie("taint", "nodes", nodeName, testTaint.ToString())
By("verifying the node has the taint " + testTaint.ToString())
output := framework.RunKubectlOrDie("describe", "node", nodeName)
output := runKubectlRetryOrDie("describe", "node", nodeName)
requiredStrings := [][]string{
{"Name:", nodeName},
{"Taints:"},
@ -1341,7 +1341,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
By("adding another taint " + newTestTaint.ToString() + " to the node")
runKubectlRetryOrDie("taint", "nodes", nodeName, newTestTaint.ToString())
By("verifying the node has the taint " + newTestTaint.ToString())
output = framework.RunKubectlOrDie("describe", "node", nodeName)
output = runKubectlRetryOrDie("describe", "node", nodeName)
requiredStrings = [][]string{
{"Name:", nodeName},
{"Taints:"},
@ -1352,7 +1352,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
By("removing all taints that have the same key " + testTaint.Key + " of the node")
runKubectlRetryOrDie("taint", "nodes", nodeName, testTaint.Key+"-")
By("verifying the node doesn't have the taints that have the same key " + testTaint.Key)
output = framework.RunKubectlOrDie("describe", "node", nodeName)
output = runKubectlRetryOrDie("describe", "node", nodeName)
if strings.Contains(output, testTaint.Key) {
framework.Failf("Failed removing taints " + testTaint.Key + " of the node " + nodeName)
}