Skip to content

Commit

Permalink
Merge pull request rook#13170 from parth-gr/objectsuite-ci
Browse files Browse the repository at this point in the history
ci: fix objectsuite flakiness
  • Loading branch information
BlaineEXE authored Nov 9, 2023
2 parents a7fce61 + 40295a9 commit 65d5920
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/framework/utils/k8s_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ func (k8sh *K8sHelper) GetResource(args ...string) (string, error) {
if err == nil {
return result, nil
}
return "", fmt.Errorf("Could Not get resource in k8s -- %v", err)
return result, fmt.Errorf("Could Not get resource in k8s -- %v", err)
}

func (k8sh *K8sHelper) CreateNamespace(namespace string) error {
Expand Down
8 changes: 8 additions & 0 deletions tests/integration/ceph_base_object_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"os"
"path/filepath"
"strconv"
"strings"
"testing"
"time"

Expand All @@ -35,6 +36,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"
)
Expand Down Expand Up @@ -192,6 +194,12 @@ func assertObjectStoreDeletion(t *testing.T, k8sh *utils.K8sHelper, namespace, s
sleepTime := 3 * time.Second
for i = 0; i < retry; i++ {
storeStr, err := k8sh.GetResource("-n", namespace, "CephObjectStore", storeName, "-o", "json")
// if cephobjectstore is not found, just return the test
// no need to check deletion phases as it is already deleted
if err != nil && strings.Contains(storeStr, errors.NewNotFound(v1.Resource("cephobjectstores.ceph.rook.io"), storeName).ErrStatus.Message) {
return
}

assert.NoError(t, err)
logger.Infof("store: \n%s", storeStr)

Expand Down

0 comments on commit 65d5920

Please sign in to comment.