MCPcopy
hub / github.com/grafana/dskit / TestCASErrorNoRetry

Function TestCASErrorNoRetry

kv/memberlist/memberlist_client_test.go:474–484  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

472}
473
474func TestCASErrorNoRetry(t *testing.T) {
475 withFixtures(t, func(t *testing.T, kv *Client) {
476 calls := 0
477 err := casWithErr(context.Background(), kv, key, func(*data) (*data, bool, error) {
478 calls++
479 return nil, false, errors.New("don't worry, be happy")
480 })
481 require.EqualError(t, err, "failed to CAS-update key test: fn returned error: don't worry, be happy")
482 require.Equal(t, 1, calls)
483 })
484}
485
486func TestCASErrorWithRetries(t *testing.T) {
487 withFixtures(t, func(t *testing.T, kv *Client) {

Callers

nothing calls this directly

Calls 3

casWithErrFunction · 0.85
withFixturesFunction · 0.70
EqualMethod · 0.45

Tested by

no test coverage detected