diff --git a/tests/e2e/hcp_machine_pool_test.go b/tests/e2e/hcp_machine_pool_test.go index 1661ca61..7bcf9e51 100644 --- a/tests/e2e/hcp_machine_pool_test.go +++ b/tests/e2e/hcp_machine_pool_test.go @@ -263,7 +263,7 @@ var _ = Describe("HCP MachinePool", ci.Day2, ci.FeatureMachinepool, func() { Replicas: helper.IntPointer(replicas), MachineType: helper.StringPointer(machineType), Name: helper.StringPointer(name), - AdditionalSecurityGroups: helper.StringSlicePointer(output.SGIDs), + AdditionalSecurityGroups: helper.StringSlicePointer(sgIDs), AutoscalingEnabled: helper.BoolPointer(false), AutoRepair: helper.BoolPointer(false), SubnetID: helper.StringPointer(vpcOutput.PrivateSubnets[0]), diff --git a/tests/utils/profilehandler/handler.go b/tests/utils/profilehandler/handler.go index b119802a..891bbbac 100644 --- a/tests/utils/profilehandler/handler.go +++ b/tests/utils/profilehandler/handler.go @@ -1054,9 +1054,20 @@ func (ctx *profileContext) DestroyRHCSClusterResources(token string) error { if err != nil { errs = append(errs, err) } else { - _, err = vpcService.Destroy() + _, err := vpcService.Destroy() if err != nil { - errs = append(errs, err) + if strings.Contains(err.Error(), "DependencyViolation") { + Logger.Warnf("DependencyViolation, waiting for 15 minutes before retrying. The error is %v", err) + // Waiting 15 minutes for the vpc to be deleted and retry one time is as a workaround. + // Will remove this after the vpc dependency can be deleted before the vpc itself by monitoring the jobs result + time.Sleep(15 * time.Minute) + _, err = vpcService.Destroy() + if err != nil { + errs = append(errs, err) + } + } else { + errs = append(errs, err) + } } } }