RequireWaitForStat will retry for up to 20 seconds until the result of getStatFunc is equal to the expected value.
(t testing.TB, getStatFunc func() int64, expected int64)
| 742 | |
| 743 | // RequireWaitForStat will retry for up to 20 seconds until the result of getStatFunc is equal to the expected value. |
| 744 | func RequireWaitForStat(t testing.TB, getStatFunc func() int64, expected int64) (val int64) { |
| 745 | require.EventuallyWithT(t, func(c *assert.CollectT) { |
| 746 | val = getStatFunc() |
| 747 | assert.Equal(c, expected, val) |
| 748 | }, 20*time.Second, 100*time.Millisecond) |
| 749 | return val |
| 750 | } |
| 751 | |
| 752 | // TestRequiresCollections will skip the current test if the Couchbase Server version it is running against does not |
| 753 | // support collections. |