Skip to content

Commit 87b1ccf

Browse files
enxebreclaude
andcommitted
fix: NO-JIRA: increase envtest CRD install/uninstall timeouts to 60s
The 30s timeouts for CRD installation and removal in envtest are too tight under CI resource pressure, causing flaky failures when the API server takes longer to fully remove CRDs between test phases. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 88b85c3 commit 87b1ccf

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

test/envtest/generator.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,12 @@ func GenerateTestSuite(suiteSpec SuiteSpec) {
188188
},
189189
})
190190
return err
191-
}, "30s", "1s").Should(Succeed(), "CRD should install successfully")
191+
}, "120s", "1s").Should(Succeed(), "CRD should install successfully")
192192
Expect(crds).To(HaveLen(1), "Only one CRD should have been installed")
193193
crd = crds[0]
194194

195195
Expect(envtest.WaitForCRDs(cfg, crds, envtest.CRDInstallOptions{
196-
MaxTime: 30 * time.Second,
196+
MaxTime: 120 * time.Second,
197197
})).To(Succeed())
198198
})
199199

@@ -212,7 +212,7 @@ func GenerateTestSuite(suiteSpec SuiteSpec) {
212212
Eventually(func() bool {
213213
err := k8sClient.Get(ctx, client.ObjectKeyFromObject(crd), &apiextensionsv1.CustomResourceDefinition{})
214214
return apierrors.IsNotFound(err)
215-
}, "30s", "1s").Should(BeTrue(), fmt.Sprintf("CRD %s should be fully removed", crd.Name))
215+
}, "120s", "1s").Should(BeTrue(), fmt.Sprintf("CRD %s should be fully removed", crd.Name))
216216
})
217217

218218
generateOnCreateTable(suiteSpec.Tests.OnCreate)
@@ -244,7 +244,7 @@ func GenerateCRDInstallTest(featureSet string) {
244244
CRDs: crdsToInstall,
245245
})
246246
return err
247-
}, "60s", "1s").Should(Succeed(), "all CRDs should install without error")
247+
}, "120s", "1s").Should(Succeed(), "all CRDs should install without error")
248248
Expect(crds).To(HaveLen(len(allCRDs)), "all CRDs should have been installed")
249249
Expect(envtest.WaitForCRDs(cfg, crds, envtest.CRDInstallOptions{})).To(Succeed())
250250

@@ -259,7 +259,7 @@ func GenerateCRDInstallTest(featureSet string) {
259259
Eventually(func() bool {
260260
err := k8sClient.Get(ctx, key, &apiextensionsv1.CustomResourceDefinition{})
261261
return apierrors.IsNotFound(err)
262-
}, "30s", "1s").Should(BeTrue(), fmt.Sprintf("CRD %s should be fully removed", crd.Name))
262+
}, "120s", "1s").Should(BeTrue(), fmt.Sprintf("CRD %s should be fully removed", crd.Name))
263263
}
264264
})
265265
}

0 commit comments

Comments
 (0)