MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / RequireWaitForStat

Function RequireWaitForStat

base/util_testing.go:744–750  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

742
743// RequireWaitForStat will retry for up to 20 seconds until the result of getStatFunc is equal to the expected value.
744func 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.

Calls 1

EqualMethod · 0.45