From ed15c94cca3b070e6c848ea83717bf6a78ca6754 Mon Sep 17 00:00:00 2001 From: Matt Moore Date: Mon, 16 Nov 2020 08:27:34 -0800 Subject: [PATCH] Use logstream in the duplicate_test --- test/duplicate_test.go | 9 +++++---- test/v1alpha1/duplicate_test.go | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/test/duplicate_test.go b/test/duplicate_test.go index 70682860e7b..350a061df74 100644 --- a/test/duplicate_test.go +++ b/test/duplicate_test.go @@ -29,15 +29,16 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" knativetest "knative.dev/pkg/test" + "knative.dev/pkg/test/helpers" ) // TestDuplicatePodTaskRun creates 10 builds and checks that each of them has only one build pod. func TestDuplicatePodTaskRun(t *testing.T) { - ctx := context.Background() - ctx, cancel := context.WithCancel(ctx) + t.Parallel() + + ctx, cancel := context.WithCancel(context.Background()) defer cancel() c, namespace := setup(ctx, t) - t.Parallel() knativetest.CleanupOnInterrupt(func() { tearDown(ctx, t, c, namespace) }, t.Logf) defer tearDown(ctx, t, c, namespace) @@ -45,7 +46,7 @@ func TestDuplicatePodTaskRun(t *testing.T) { var wg sync.WaitGroup for i := 0; i < 25; i++ { wg.Add(1) - taskrunName := fmt.Sprintf("duplicate-pod-taskrun-%d", i) + taskrunName := helpers.ObjectNameForTest(t) t.Logf("Creating taskrun %q.", taskrunName) taskrun := &v1beta1.TaskRun{ diff --git a/test/v1alpha1/duplicate_test.go b/test/v1alpha1/duplicate_test.go index 19be6e7e729..fe1ab6bb13d 100644 --- a/test/v1alpha1/duplicate_test.go +++ b/test/v1alpha1/duplicate_test.go @@ -28,16 +28,16 @@ import ( "github.com/tektoncd/pipeline/pkg/apis/pipeline" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" knativetest "knative.dev/pkg/test" + "knative.dev/pkg/test/helpers" ) // TestDuplicatePodTaskRun creates 10 builds and checks that each of them has only one build pod. func TestDuplicatePodTaskRun(t *testing.T) { - ctx := context.Background() - ctx, cancel := context.WithCancel(ctx) + t.Parallel() + ctx, cancel := context.WithCancel(context.Background()) defer cancel() c, namespace := setup(ctx, t) - t.Parallel() knativetest.CleanupOnInterrupt(func() { tearDown(ctx, t, c, namespace) }, t.Logf) defer tearDown(ctx, t, c, namespace) @@ -45,7 +45,7 @@ func TestDuplicatePodTaskRun(t *testing.T) { var wg sync.WaitGroup for i := 0; i < 25; i++ { wg.Add(1) - taskrunName := fmt.Sprintf("duplicate-pod-taskrun-%d", i) + taskrunName := helpers.ObjectNameForTest(t) t.Logf("Creating taskrun %q.", taskrunName) taskrun := tb.TaskRun(taskrunName, tb.TaskRunSpec(