(ctx context.Context, _ string, _ []byte, _ time.Duration)
| 5776 | } |
| 5777 | |
| 5778 | func (s *mockContextAwareStorage) SetWithContext(ctx context.Context, _ string, _ []byte, _ time.Duration) error { |
| 5779 | s.t.Helper() |
| 5780 | if s.validateCtx == nil { |
| 5781 | s.helperFailure("validateCtx must be configured before SetWithContext") |
| 5782 | } |
| 5783 | s.validateCtx(ctx) |
| 5784 | if val := ctx.Value(s.key); val != s.expectedValue { |
| 5785 | s.helperFailure("storage observed unexpected context value: %v", val) |
| 5786 | } |
| 5787 | s.ctxMatched.Store(true) |
| 5788 | if s.cancel != nil { |
| 5789 | s.cancel() |
| 5790 | } |
| 5791 | select { |
| 5792 | case <-ctx.Done(): |
| 5793 | s.cancelObserved.Store(true) |
| 5794 | case <-time.After(100 * time.Millisecond): |
| 5795 | s.helperFailure("storage did not observe context cancellation") |
| 5796 | } |
| 5797 | return nil |
| 5798 | } |
| 5799 | |
| 5800 | func (s *mockContextAwareStorage) Set(string, []byte, time.Duration) error { |
| 5801 | s.helperFailure("unexpected call to Set") |
nothing calls this directly
no test coverage detected