(t testing.TB, successFunc func() bool, maxNumAttempts, timeToSleepMs int)
| 710 | } |
| 711 | |
| 712 | func 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 | |
| 729 | func CreateLegacyAttachmentDoc(t *testing.T, ctx context.Context, db *DatabaseCollectionWithUser, docID string, body []byte, attID string, attBody []byte) string { |
| 730 | if !base.TestUseXattrs() { |
no test coverage detected