Skip to content

Commit 661ed4e

Browse files
vdemeesterclaude
andcommitted
test: Use PipelineRun-level timeout instead of global config
Instead of modifying the global config-defaults ConfigMap (which affects all tests running in parallel), set the timeout directly on the PipelineRun spec using `timeouts.pipeline: "0s"`. This prevents interference with other e2e tests that run in parallel and expect the default timeout behavior. Benefits: - No ConfigMap modification needed - No cleanup/restore logic required - Test is isolated and doesn't affect other parallel tests - Simpler and more focused test 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 6e96616 commit 661ed4e

File tree

1 file changed

+4
-28
lines changed

1 file changed

+4
-28
lines changed

test/excessive_reconciliation_test.go

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -69,34 +69,6 @@ func TestPipelineRunExcessiveReconciliation(t *testing.T) {
6969
knativetest.CleanupOnInterrupt(func() { tearDown(ctx, t, c, namespace) }, t.Logf)
7070
defer tearDown(ctx, t, c, namespace)
7171

72-
// This test modifies global config-defaults ConfigMap, so it must not run in parallel
73-
// to avoid affecting other tests. We don't call t.Parallel() to ensure serialization.
74-
75-
tektonNamespace := getTektonNamespace()
76-
77-
// Get the original default-timeout-minutes value for restoration
78-
configDefaults, err := c.KubeClient.CoreV1().ConfigMaps(tektonNamespace).Get(ctx, "config-defaults", metav1.GetOptions{})
79-
if err != nil {
80-
t.Fatalf("Failed to get config-defaults ConfigMap: %v", err)
81-
}
82-
originalTimeoutMinutes := configDefaults.Data["default-timeout-minutes"]
83-
84-
// Update config to set timeout to 0
85-
if err := updateConfigMap(ctx, c.KubeClient, tektonNamespace, "config-defaults", map[string]string{
86-
"default-timeout-minutes": "0",
87-
}); err != nil {
88-
t.Fatalf("Failed to update config-defaults ConfigMap: %v", err)
89-
}
90-
91-
// Restore original value on cleanup - fetch fresh copy to avoid conflicts
92-
defer func() {
93-
if err := updateConfigMap(ctx, c.KubeClient, tektonNamespace, "config-defaults", map[string]string{
94-
"default-timeout-minutes": originalTimeoutMinutes,
95-
}); err != nil {
96-
t.Logf("Warning: Failed to restore config-defaults ConfigMap: %v", err)
97-
}
98-
}()
99-
10072
pipelineRunName := helpers.ObjectNameForTest(t)
10173

10274
// Create a ConfigMap that will be mounted by the Task
@@ -114,6 +86,10 @@ metadata:
11486
name: %s
11587
namespace: %s
11688
spec:
89+
# Set timeout to 0 to disable timeout and trigger the excessive reconciliation bug
90+
# Without the fix, this causes hundreds or thousands of reconciliations
91+
timeouts:
92+
pipeline: "0s"
11793
pipelineSpec:
11894
tasks:
11995
- name: event-generating-task

0 commit comments

Comments
 (0)