From e9a7fd5f29644f7b7dc3807561e5df146b5b569d Mon Sep 17 00:00:00 2001 From: Gunju Kim Date: Thu, 16 Apr 2026 12:50:47 +0000 Subject: [PATCH] Speed up e2e test runtime by parallelizing specs and tightening polling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable Ginkgo parallel execution with -p and reduce polling intervals from 10s to 2s in framework waits and TaskSpawner tests. Each spec already creates its own namespace via the framework, so parallel execution is safe. Most test durations were dominated by the 10s poll interval — dropping to 2s lets short-lived jobs finish earlier while still keeping polling cheap. Co-Authored-By: Claude Opus 4.6 --- Makefile | 2 +- test/e2e/framework/framework.go | 6 +++--- test/e2e/taskspawner_test.go | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 72bd3a69..edda7d71 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,7 @@ test-integration: envtest ## Run integration tests (envtest). .PHONY: test-e2e test-e2e: ginkgo ## Run e2e tests (requires cluster and agent credentials). - $(GINKGO) -v --timeout 20m ./test/e2e/... + $(GINKGO) -v --timeout 20m -p ./test/e2e/... .PHONY: update update: controller-gen yamlfmt shfmt ## Run all generators and formatters. diff --git a/test/e2e/framework/framework.go b/test/e2e/framework/framework.go index 283ab3b3..bcca005b 100644 --- a/test/e2e/framework/framework.go +++ b/test/e2e/framework/framework.go @@ -283,7 +283,7 @@ func (f *Framework) WaitForJobCompletion(name string) { } } return false - }, 5*time.Minute, 10*time.Second).Should(BeTrue()) + }, 5*time.Minute, 2*time.Second).Should(BeTrue()) } // WaitForDeploymentAvailable waits for a Deployment to reach the available condition. @@ -299,7 +299,7 @@ func (f *Framework) WaitForDeploymentAvailable(name string) { } } return false - }, 2*time.Minute, 10*time.Second).Should(BeTrue()) + }, 2*time.Minute, 2*time.Second).Should(BeTrue()) } // WaitForCronJobCreated waits for a CronJob with the given name to appear. @@ -307,7 +307,7 @@ func (f *Framework) WaitForCronJobCreated(name string) { Eventually(func() error { _, err := f.Clientset.BatchV1().CronJobs(f.Namespace).Get(context.TODO(), name, metav1.GetOptions{}) return err - }, 2*time.Minute, 10*time.Second).Should(Succeed()) + }, 2*time.Minute, 2*time.Second).Should(Succeed()) } // GetTaskPhase returns the phase of a Task. diff --git a/test/e2e/taskspawner_test.go b/test/e2e/taskspawner_test.go index d1e12020..14976c80 100644 --- a/test/e2e/taskspawner_test.go +++ b/test/e2e/taskspawner_test.go @@ -77,12 +77,12 @@ var _ = Describe("TaskSpawner", func() { By("waiting for TaskSpawner phase to become Running") Eventually(func() string { return f.GetTaskSpawnerPhase("spawner") - }, 3*time.Minute, 10*time.Second).Should(Equal("Running")) + }, 3*time.Minute, 2*time.Second).Should(Equal("Running")) By("verifying at least one Task was created") Eventually(func() []string { return f.ListTaskNames("kelos.dev/taskspawner=spawner") - }, 3*time.Minute, 10*time.Second).ShouldNot(BeEmpty()) + }, 3*time.Minute, 2*time.Second).ShouldNot(BeEmpty()) }) It("should be accessible via CLI", func() { @@ -188,12 +188,12 @@ var _ = Describe("Cron TaskSpawner", func() { By("waiting for TaskSpawner phase to become Running") Eventually(func() string { return f.GetTaskSpawnerPhase("cron-spawner") - }, 3*time.Minute, 10*time.Second).Should(Equal("Running")) + }, 3*time.Minute, 2*time.Second).Should(Equal("Running")) By("verifying at least one Task was created") Eventually(func() []string { return f.ListTaskNames("kelos.dev/taskspawner=cron-spawner") - }, 3*time.Minute, 10*time.Second).ShouldNot(BeEmpty()) + }, 3*time.Minute, 2*time.Second).ShouldNot(BeEmpty()) }) It("should be accessible via CLI with cron source info", func() {