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

Function TestRetryLoopFastFail

base/util_test.go:215–225  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

213}
214
215func TestRetryLoopFastFail(t *testing.T) {
216 numTimesInvoked := 0
217 worker := func() (shouldRetry bool, err error, value any) {
218 numTimesInvoked += 1
219 return true, nil, nil
220 }
221
222 err, _ := RetryLoop(TestCtx(t), t.Name(), worker, CreateFastFailRetrySleeperFunc())
223 require.ErrorContains(t, err, "giving up after 1 attempts")
224 require.Equal(t, 1, numTimesInvoked)
225}
226
227func TestRetryLoopContextCancellation(t *testing.T) {
228 var invoked atomic.Bool

Callers

nothing calls this directly

Calls 5

RetryLoopFunction · 0.85
TestCtxFunction · 0.85
NameMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected