ContainerImage.Pinniped/test
Matt Moyer 3efa7bdcc2
Improve our integration test "Eventually" assertions.
This fixes some rare test flakes caused by a data race inherent in the way we use `assert.Eventually()` with extra variables for followup assertions. This function is tricky to use correctly because it runs the passed function in a separate goroutine, and you have no guarantee that any shared variables are in a coherent state when the `assert.Eventually()` call returns. Even if you add manual mutexes, it's tricky to get the semantics right. This has been a recurring pain point and the cause of several test flakes.

This change introduces a new `library.RequireEventually()` that works by internally constructing a per-loop `*require.Assertions` and running everything on a single goroutine (using `wait.PollImmediate()`). This makes it very easy to write eventual assertions.

Signed-off-by: Matt Moyer <moyerm@vmware.com>
2021-06-17 16:56:03 -05:00
..
cluster_capabilities Enable skipping of LDAP int tests when a firewall will block them 2021-05-28 16:13:20 -07:00
deploy/tools Parameterize our test images in ytt. 2021-06-03 15:25:09 -05:00
integration Improve our integration test "Eventually" assertions. 2021-06-17 16:56:03 -05:00
library Improve our integration test "Eventually" assertions. 2021-06-17 16:56:03 -05:00