csi-driver-spiffe
csi-driver-spiffe copied to clipboard
Increase e2e test timeouts
Currently timeouts for checking for success are scattered across tests (e.g. here) and so are hard to change.
They're also quite low and could easily flake in a resource constrained testing environment.
It would be better to have a single const controlling global timeouts to make this easier to change and to make it obvious what's happening.
The above linked code block could be rewritten to:
Eventually(func() bool {
Expect(f.Client().Get(f.Context(), client.ObjectKeyFromObject(&certificateRequest), &certificateRequest)).NotTo(HaveOccurred())
return apiutil.CertificateRequestIsApproved(&certificateRequest)
}).WithTimeout(testTimeout).WithInterval(pollInterval).WithContext(ctx).Should(BeTrue(), "expected request to become approved in time")
Note that this also passes the context into the Eventually
function which would be useful if we were to enforce a global timeout on all e2e tests in the future