Skip to content

Commit c9d2cf9

Browse files
committed
Improve code consistency and fix missing test annotation
Use early returns in timeout handling for better code consistency and readability throughout the reconciliation logic. Add missing @test:execution=parallel annotation to the excessive reconciliation e2e test for proper test categorization. Addresses review feedback from PR tektoncd#9202.
1 parent 798b72f commit c9d2cf9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pkg/reconciler/pipelinerun/pipelinerun.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ func (c *Reconciler) ReconcileKind(ctx context.Context, pr *v1.PipelineRun) pkgr
295295
if timeout != config.NoTimeoutDuration {
296296
waitTime := timeout - elapsed
297297
if finallyWaitTime < waitTime {
298-
waitTime = finallyWaitTime
298+
return controller.NewRequeueAfter(finallyWaitTime)
299299
}
300300
return controller.NewRequeueAfter(waitTime)
301301
}

test/excessive_reconciliation_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,15 @@ func getTektonNamespace() string {
5959
// With the fix, reconciliations should stay well below 20 (typically around 10 or less).
6060
//
6161
// This test validates the fix by counting actual reconciliations from controller logs.
62+
//
63+
// @test:execution=parallel
6264
func TestPipelineRunExcessiveReconciliation(t *testing.T) {
6365
ctx := t.Context()
6466
ctx, cancel := context.WithCancel(ctx)
6567
defer cancel()
6668

6769
c, namespace := setup(ctx, t)
70+
t.Parallel()
6871

6972
knativetest.CleanupOnInterrupt(func() { tearDown(ctx, t, c, namespace) }, t.Logf)
7073
defer tearDown(ctx, t, c, namespace)

0 commit comments

Comments
 (0)