csi-driver-spiffe icon indicating copy to clipboard operation
csi-driver-spiffe copied to clipboard

Increase e2e test timeouts

Open SgtCoDFish opened this issue 9 months ago • 0 comments

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

SgtCoDFish avatar Apr 29 '24 12:04 SgtCoDFish