Merge pull request #61941 from bskiba/retry-ng-deletion

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Retry node pool deletion in autoscaling tests.

**What this PR does / why we need it**:
Currently, when there is already an operation running on the cluster, the node pool deletion will fail. This will in turn make other tests that try to  add extra node pool fail.
With this PR we will retry the node pool deletion operation 3 times over the course of ~15 minutes which will hopefully be enough to finish any operations running on the cluster.
This will deflake autoscaling e2e tests on gke regional clusters. 

**Release note**:
```
NONE
```

@aleksandra-malinowska
This commit is contained in:
Kubernetes Submit Queue 2018-04-04 13:00:46 -07:00 committed by GitHub
commit cd570c092b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1304,11 +1304,18 @@ func deleteNodePool(name string) {
glog.Infof("Deleting node pool %s", name)
args := []string{"container", "node-pools", "delete", name, "--quiet",
"--cluster=" + framework.TestContext.CloudConfig.Cluster}
output, err := execCmd(getGcloudCommand(args)...).CombinedOutput()
if err != nil {
glog.Infof("Error: %v", err)
}
glog.Infof("Node-pool deletion output: %s", output)
err := wait.ExponentialBackoff(
wait.Backoff{Duration: 1 * time.Minute, Factor: float64(3), Steps: 3},
func() (bool, error) {
output, err := execCmd(getGcloudCommand(args)...).CombinedOutput()
if err != nil {
glog.Warningf("Error deleting nodegroup - error:%v, output: %s", err, output)
return false, nil
}
glog.Infof("Node-pool deletion output: %s", output)
return true, nil
})
framework.ExpectNoError(err)
}
func getPoolNodes(f *framework.Framework, poolName string) []*v1.Node {