From b1f5a805394848a86119f240e8de26b7e3aa4470 Mon Sep 17 00:00:00 2001 From: yuwang-RH Date: Mon, 4 Nov 2024 17:43:16 +0800 Subject: [PATCH] OCM-12269 | ci: fix with reducing the number of sg in id:73068 --- tests/e2e/hcp_machine_pool_test.go | 2 +- tests/utils/profilehandler/handler.go | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) 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..3f41aec1 100644 --- a/tests/utils/profilehandler/handler.go +++ b/tests/utils/profilehandler/handler.go @@ -1054,9 +1054,18 @@ 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) + time.Sleep(15 * time.Minute) + _, err = vpcService.Destroy() + if err != nil { + errs = append(errs, err) + } + } else { + errs = append(errs, err) + } } } }