(t *testing.T)
| 146 | } |
| 147 | |
| 148 | func TestRetryStandardError(t *testing.T) { |
| 149 | var attempts atomic.Int32 |
| 150 | op := buildZeroArgAsync(t, async.RetryBinding(func(ctx context.Context, args ...ref.Val) ref.Val { |
| 151 | attempts.Add(1) |
| 152 | return types.NewErr("generic error") |
| 153 | }, async.RetryAttempts(5), async.RetryBackoff(10*time.Millisecond))) |
| 154 | |
| 155 | res := <-op(context.Background()) |
| 156 | if !types.IsError(res) || !strings.Contains(res.(*types.Err).Error(), "generic error") { |
| 157 | t.Fatalf("result = %v, want 'generic error'", res) |
| 158 | } |
| 159 | if got := attempts.Load(); got != 1 { |
| 160 | t.Errorf("attempts = %d, want 1 (standard error should not be retried)", got) |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | type mockAsyncCall struct { |
| 165 | id int64 |
nothing calls this directly
no test coverage detected