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

Function WaitForConditionWithOptions

db/attachment_compaction_test.go:712–727  ·  view source on GitHub ↗
(t testing.TB, successFunc func() bool, maxNumAttempts, timeToSleepMs int)

Source from the content-addressed store, hash-verified

710}
711
712func WaitForConditionWithOptions(t testing.TB, successFunc func() bool, maxNumAttempts, timeToSleepMs int) error {
713 waitForSuccess := func() (shouldRetry bool, err error, value interface{}) {
714 if successFunc() {
715 return false, nil, nil
716 }
717 return true, nil, nil
718 }
719
720 sleeper := base.CreateSleeperFunc(maxNumAttempts, timeToSleepMs)
721 err, _ := base.RetryLoop(base.TestCtx(t), "Wait for condition options", waitForSuccess, sleeper)
722 if err != nil {
723 return err
724 }
725
726 return nil
727}
728
729func CreateLegacyAttachmentDoc(t *testing.T, ctx context.Context, db *DatabaseCollectionWithUser, docID string, body []byte, attID string, attBody []byte) string {
730 if !base.TestUseXattrs() {

Calls 3

CreateSleeperFuncFunction · 0.92
RetryLoopFunction · 0.92
TestCtxFunction · 0.92

Tested by

no test coverage detected