Skip to content

Commit

Permalink
Use logstream in the duplicate_test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmoor authored and tekton-robot committed Nov 16, 2020
1 parent ccc74ff commit ed15c94
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions test/duplicate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,24 @@ 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)

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{
Expand Down
8 changes: 4 additions & 4 deletions test/v1alpha1/duplicate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@ 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)

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(
Expand Down

0 comments on commit ed15c94

Please sign in to comment.