(ctx context.Context)
| 27 | var count int |
| 28 | |
| 29 | func EmulateTransientError(ctx context.Context) (string, error) { |
| 30 | count++ |
| 31 | |
| 32 | if count <= 3 { |
| 33 | return "intentional fail", errors.New("error") |
| 34 | } else { |
| 35 | return "success", nil |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | func TestRetry(t *testing.T) { |
| 40 | ctx := context.Background() |
nothing calls this directly
no outgoing calls
no test coverage detected