buildZeroArgAsync builds a zero-arity async overload from an option and returns its AsyncOp.
(t *testing.T, opt decls.OverloadOpt)
| 41 | |
| 42 | // buildZeroArgAsync builds a zero-arity async overload from an option and returns its AsyncOp. |
| 43 | func buildZeroArgAsync(t *testing.T, opt decls.OverloadOpt) functions.AsyncOp { |
| 44 | t.Helper() |
| 45 | fnDecl, err := decls.NewFunction("fn", decls.Overload("fn_zero", []*types.Type{}, types.IntType, opt)) |
| 46 | if err != nil { |
| 47 | t.Fatalf("NewFunction() failed: %v", err) |
| 48 | } |
| 49 | bindings, err := fnDecl.Bindings() |
| 50 | if err != nil { |
| 51 | t.Fatalf("Bindings() failed: %v", err) |
| 52 | } |
| 53 | for _, b := range bindings { |
| 54 | if b.Async != nil { |
| 55 | return b.Async |
| 56 | } |
| 57 | } |
| 58 | t.Fatal("no async binding produced") |
| 59 | return nil |
| 60 | } |
| 61 | |
| 62 | func TestRetryMultipleAttemptsTimerReset(t *testing.T) { |
| 63 | var attempts atomic.Int32 |
no test coverage detected