Skip to content

Commit

Permalink
Increase CRD load test time limit to 0.3s
Browse files Browse the repository at this point in the history
  • Loading branch information
hjiawei committed Dec 13, 2024
1 parent a450e1e commit 2686705
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/crds/crds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,37 @@ var _ = Describe("test crds pkg", func() {
runtime := b.Time("runtime", func() {
_ = getCalicoCRDSource()
})
Expect(runtime.Seconds()).Should(BeNumerically("<", 0.2), "loading calico CRDs shouldnt take too long.")
Expect(runtime.Seconds()).Should(BeNumerically("<", 0.3), "loading calico CRDs should not take too long.")
}, 50)
})
Context("GetEnterpriseCRDSource", func() {
Measure("should quickly load enterprise source CRDs", func(b Benchmarker) {
runtime := b.Time("runtime", func() {
_ = getEnterpriseCRDSource()
})
Expect(runtime.Seconds()).Should(BeNumerically("<", 0.2), "loading enterprise CRDs shouldnt take too long.")
Expect(runtime.Seconds()).Should(BeNumerically("<", 0.3), "loading enterprise CRDs should not take too long.")
}, 50)
})
Context("GetOperatorCRDSource", func() {
Measure("should quickly load operator source CRDs", func(b Benchmarker) {
runtime := b.Time("runtime", func() {
_ = getEnterpriseCRDSource()
})
Expect(runtime.Seconds()).Should(BeNumerically("<", 0.2), "loading operator CRDs shouldnt take too long.")
Expect(runtime.Seconds()).Should(BeNumerically("<", 0.3), "loading operator CRDs should not take too long.")
}, 50)
})
Context("GetCRDs", func() {
Measure("should quickly load calico CRDs", func(b Benchmarker) {
runtime := b.Time("runtime", func() {
_ = GetCRDs(opv1.Calico)
})
Expect(runtime.Seconds()).Should(BeNumerically("<", 0.2), "loading calico CRDs shouldnt take too long.")
Expect(runtime.Seconds()).Should(BeNumerically("<", 0.3), "loading calico CRDs should not take too long.")
}, 50)
Measure("should quickly load enterprise CRDs", func(b Benchmarker) {
runtime := b.Time("runtime", func() {
_ = GetCRDs(opv1.TigeraSecureEnterprise)
})
Expect(runtime.Seconds()).Should(BeNumerically("<", 0.2), "loading enterprise CRDs shouldnt take too long.")
Expect(runtime.Seconds()).Should(BeNumerically("<", 0.3), "loading enterprise CRDs should not take too long.")
}, 50)
})
})

0 comments on commit 2686705

Please sign in to comment.