Skip to content

Commit 78e6711

Browse files
authored
Aim for namespace uniqueness across parallel specs (#7680)
ensure namespace uniqueness across parallel specs
1 parent 53aa373 commit 78e6711

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

integration/utilities/kube/kube.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@
44
package kube
55

66
import (
7-
"fmt"
8-
97
harness "github.com/dlespiau/kube-test-harness"
108
"github.com/dlespiau/kube-test-harness/logger"
9+
"github.com/google/uuid"
1110
"github.com/onsi/ginkgo/v2"
1211
)
1312

1413
type tHelper struct{ ginkgo.FullGinkgoTInterface }
1514

1615
func (t *tHelper) Helper() {}
17-
func (t *tHelper) Name() string { return "eksctl-test" }
16+
func (t *tHelper) Name() string { return "eksctl" }
1817

1918
// NewTest creates a new test harness to more easily run integration tests against the provided Kubernetes cluster.
2019
func NewTest(kubeconfigPath string) (*harness.Test, error) {
@@ -28,7 +27,9 @@ func NewTest(kubeconfigPath string) (*harness.Test, error) {
2827
return nil, err
2928
}
3029
test := h.NewTest(t)
31-
test.Namespace += fmt.Sprintf("-%d", t.ParallelProcess())
30+
// several parallel test specs may initialize a new harness and close it after completion,
31+
// thus, we aim to minimize the chance of conflicting actions against same K8s namespace
32+
test.Namespace += uuid.NewString()
3233
test.Setup()
3334
return test, nil
3435
}

0 commit comments

Comments
 (0)