(t *testing.T)
| 472 | } |
| 473 | |
| 474 | func 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 | |
| 486 | func TestCASErrorWithRetries(t *testing.T) { |
| 487 | withFixtures(t, func(t *testing.T, kv *Client) { |
nothing calls this directly
no test coverage detected