mirror of
https://github.com/coder/coder.git
synced 2025-07-09 11:45:56 +00:00
This PR adds a `testutil` function aimed to replace `require.Eventually`. Before: ```go require.Eventually(t, func() bool { ... }, testutil.WaitShort, testutil.IntervalFast) ``` After: ```go require.True(t, testutil.EventuallyShort(t, func(ctx context.Context) bool { ... })) // or the full incantation if you need more control ctx, cancel := context.WithTimeout(ctx.Background(), testutil.WaitLong) require.True(t, testutil.Eventually(t, ctx, func(ctx context.Context) bool { ... }, testutil.IntervalSlow)) ``` Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>