From dbe4f966a28e682c32bae6c7d42b990422cbfe9d Mon Sep 17 00:00:00 2001 From: Tibi <110664232+TiberiuGC@users.noreply.github.com> Date: Fri, 22 Mar 2024 17:22:26 +0200 Subject: [PATCH] ensure namespace uniqueness across parallel specs --- integration/utilities/kube/kube.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/integration/utilities/kube/kube.go b/integration/utilities/kube/kube.go index 7d2b42887d..75fb4c0092 100644 --- a/integration/utilities/kube/kube.go +++ b/integration/utilities/kube/kube.go @@ -4,17 +4,16 @@ package kube import ( - "fmt" - harness "github.com/dlespiau/kube-test-harness" "github.com/dlespiau/kube-test-harness/logger" + "github.com/google/uuid" "github.com/onsi/ginkgo/v2" ) type tHelper struct{ ginkgo.FullGinkgoTInterface } func (t *tHelper) Helper() {} -func (t *tHelper) Name() string { return "eksctl-test" } +func (t *tHelper) Name() string { return "eksctl" } // NewTest creates a new test harness to more easily run integration tests against the provided Kubernetes cluster. func NewTest(kubeconfigPath string) (*harness.Test, error) { @@ -28,7 +27,9 @@ func NewTest(kubeconfigPath string) (*harness.Test, error) { return nil, err } test := h.NewTest(t) - test.Namespace += fmt.Sprintf("-%d", t.ParallelProcess()) + // several parallel test specs may initialize a new harness and close it after completion, + // thus, we aim to minimize the chance of conflicting actions against same K8s namespace + test.Namespace += uuid.NewString() test.Setup() return test, nil }