(_ context.Context, req *taskAPI.WaitRequest)
| 123 | } |
| 124 | |
| 125 | func (s *mockTaskService) Wait(_ context.Context, req *taskAPI.WaitRequest) (*taskAPI.WaitResponse, error) { |
| 126 | reqCh, _ := s.waitRequests.LoadOrStore(req.ID, make(chan *taskAPI.WaitRequest, 128)) |
| 127 | reqCh.(chan *taskAPI.WaitRequest) <- req |
| 128 | |
| 129 | waitCh, _ := s.waitCh.Load(s.processID(req.ID, req.ExecID)) |
| 130 | if waitCh != nil { |
| 131 | <-(waitCh.(chan struct{})) |
| 132 | } |
| 133 | |
| 134 | return &taskAPI.WaitResponse{ |
| 135 | ExitStatus: 0, |
| 136 | ExitedAt: protobuf.ToTimestamp(time.Now()), |
| 137 | }, nil |
| 138 | } |
| 139 | |
| 140 | func (s *mockTaskService) PopWaitRequests(id string) (reqs []*taskAPI.WaitRequest) { |
| 141 | reqCh, _ := s.waitRequests.Load(id) |
no test coverage detected