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

Method Wait

db/util_testing.go:142–159  ·  view source on GitHub ↗

Wait uses backoff retry for up to ~33s

()

Source from the content-addressed store, hash-verified

140
141// Wait uses backoff retry for up to ~33s
142func (sw *StatWaiter) Wait() {
143 actualCount := sw.stat.Value()
144 if actualCount >= sw.targetCount {
145 return
146 }
147
148 waitTime := 1 * time.Millisecond
149 for i := 0; i < 14; i++ {
150 waitTime *= 2
151 time.Sleep(waitTime)
152 actualCount = sw.stat.Value()
153 if actualCount >= sw.targetCount {
154 return
155 }
156 }
157
158 sw.tb.Fatalf("StatWaiter.Wait timed out waiting for stat to reach %d (actual: %d) %s", sw.targetCount, actualCount, base.GetCallersName(2, true))
159}
160
161func AssertEqualBodies(t *testing.T, expected, actual Body) {
162 expectedCanonical, err := base.JSONMarshalCanonical(expected)

Callers 15

AddAndWaitMethod · 0.95
startChangesFunction · 0.45
TestConcurrentSetConfigFunction · 0.45
TestConcurrentUserWritesFunction · 0.45
TestCacheRaceFunction · 0.45
waitMethod · 0.45
GetExpiryMethod · 0.45
setCollectionIDMethod · 0.45
closeMethod · 0.45

Calls 3

GetCallersNameFunction · 0.92
ValueMethod · 0.45
FatalfMethod · 0.45

Tested by 15

TestConcurrentSetConfigFunction · 0.36
TestConcurrentUserWritesFunction · 0.36
TestCacheRaceFunction · 0.36
TestOneShotDCPFunction · 0.36
TestTerminateDCPFeedFunction · 0.36
TestBootstrapRefCountingFunction · 0.36