https://github.com/cenkalti/backoff/issues/181
(t *testing.T)
| 149 | |
| 150 | // https://github.com/cenkalti/backoff/issues/181 |
| 151 | func TestRetryMaxElapsedTimeErrorIncludesOperationError(t *testing.T) { |
| 152 | opErr := errors.New("operation error") |
| 153 | |
| 154 | _, err := Retry( |
| 155 | context.Background(), |
| 156 | func() (bool, error) { return false, opErr }, |
| 157 | WithMaxElapsedTime(time.Millisecond), |
| 158 | withTimer(&testTimer{}), |
| 159 | ) |
| 160 | if !errors.Is(err, ErrMaxElapsedTime) { |
| 161 | t.Errorf("ErrMaxElapsedTime not in result: %v", err) |
| 162 | } |
| 163 | if !errors.Is(err, opErr) { |
| 164 | t.Errorf("operation error not in result: %v", err) |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | func TestRetryError(t *testing.T) { |
| 169 | opErr := errors.New("operation error") |
nothing calls this directly
no test coverage detected
searching dependent graphs…