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

Function waitAndAssertConditionWithOptions

db/database_test.go:4355–4365  ·  view source on GitHub ↗
(t *testing.T, fn func() bool, retryCount, msSleepTime int, failureMsgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

4353}
4354
4355func waitAndAssertConditionWithOptions(t *testing.T, fn func() bool, retryCount, msSleepTime int, failureMsgAndArgs ...interface{}) {
4356 for i := 0; i <= retryCount; i++ {
4357 if i == retryCount {
4358 assert.Fail(t, "Condition failed to be satisfied", failureMsgAndArgs...)
4359 }
4360 if fn() {
4361 break
4362 }
4363 time.Sleep(time.Millisecond * time.Duration(msSleepTime))
4364 }
4365}
4366
4367func waitAndAssertCondition(t *testing.T, fn func() bool, failureMsgAndArgs ...interface{}) {
4368 waitAndAssertConditionWithOptions(t, fn, 20, 100, failureMsgAndArgs...)

Callers 2

waitAndAssertConditionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected