ContainerImage.Pinniped/test/library
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
..
browsertest Improve our integration test "Eventually" assertions. 2021-06-17 16:56:03 -05:00
access.go Improve our integration test "Eventually" assertions. 2021-06-17 16:56:03 -05:00
assertions.go Improve our integration test "Eventually" assertions. 2021-06-17 16:56:03 -05:00
cli.go Merge remote-tracking branch 'origin/main' into impersonation-proxy 2021-03-24 17:22:40 -07:00
client.go Improve our integration test "Eventually" assertions. 2021-06-17 16:56:03 -05:00
env.go Enable skipping of LDAP int tests when a firewall will block them 2021-05-28 16:13:20 -07:00
iotest.go Redact some params of URLs in logs to avoid printing sensitive info 2021-04-15 07:59:38 -07:00
iplookup.go Fix a test issue with IPv6 localhost interfaces. 2020-12-02 17:49:21 -06:00
iplookup_go1.14.go Fix a test issue with IPv6 localhost interfaces. 2020-12-02 17:49:21 -06:00
skip.go Save 2 lines by using inline-style comments for Copyright 2020-09-16 10:35:19 -04:00
spew.go Save 2 lines by using inline-style comments for Copyright 2020-09-16 10:35:19 -04:00