(context.Context)
| 56 | } |
| 57 | |
| 58 | func (f *fakeSession) Close(context.Context) error { |
| 59 | f.mu.Lock() |
| 60 | defer f.mu.Unlock() |
| 61 | if !f.closed { |
| 62 | f.closed = true |
| 63 | close(f.closedCh) |
| 64 | // Closed sessions return nil from Wait by convention. |
| 65 | select { |
| 66 | case f.failCh <- nil: |
| 67 | default: |
| 68 | } |
| 69 | } |
| 70 | return nil |
| 71 | } |
| 72 | |
| 73 | // waitClosed blocks until Close has been called on the session. |
| 74 | func (f *fakeSession) waitClosed(t *testing.T) { |