Skip to content

Commit

Permalink
Remove ginkgo.AbortSuite
Browse files Browse the repository at this point in the history
  • Loading branch information
sebrandon1 committed Dec 1, 2023
1 parent 22fd23a commit 4ca4216
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (
"sync"
"time"

"github.com/onsi/ginkgo/v2"
"github.com/sirupsen/logrus"
"github.com/test-network-function/cnf-certification-test/internal/clientsholder"
"github.com/test-network-function/cnf-certification-test/pkg/checksdb"
"github.com/test-network-function/cnf-certification-test/pkg/provider"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -140,11 +140,11 @@ func deletePod(pod *corev1.Pod, mode string, wg *sync.WaitGroup) error {
return nil
}

func CordonCleanup(node string) {
func CordonCleanup(node string, check *checksdb.Check) {
err := CordonHelper(node, Uncordon)
if err != nil {
logrus.Errorf("cleanup: error uncordoning the node: %s, err=%s", node, err)
ginkgo.AbortSuite(fmt.Sprintf("cleanup: error uncordoning the node: %s, err=%s", node, err))
check.SetResultAborted(fmt.Sprintf("cleanup: error uncordoning the node: %s, err=%s", node, err))
}
}

Expand Down
2 changes: 1 addition & 1 deletion cnf-certification-test/lifecycle/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ func testPodsRecreation(check *checksdb.Check, env *provider.TestEnvironment) {
}

for nodeName := range podsets.GetAllNodesForAllPodSets(env.Pods) {
defer podrecreation.CordonCleanup(nodeName) //nolint:gocritic // The defer in loop is intentional, calling the cleanup function once per node
defer podrecreation.CordonCleanup(nodeName, check) //nolint:gocritic // The defer in loop is intentional, calling the cleanup function once per node
err := podrecreation.CordonHelper(nodeName, podrecreation.Cordon)
if err != nil {
logrus.Errorf("error cordoning the node: %s", nodeName)
Expand Down

0 comments on commit 4ca4216

Please sign in to comment.