(req *cortexpb.StreamWriteRequest)
| 266 | } |
| 267 | |
| 268 | func (s *slowSendStream) Send(req *cortexpb.StreamWriteRequest) (retErr error) { |
| 269 | defer func() { |
| 270 | if r := recover(); r != nil { |
| 271 | s.panicCh <- r // forward the panic value to the test |
| 272 | } else { |
| 273 | s.panicCh <- nil |
| 274 | } |
| 275 | }() |
| 276 | |
| 277 | // gRPC codec pre-computes buffer size. |
| 278 | size := req.Size() |
| 279 | buf := make([]byte, size) |
| 280 | |
| 281 | // Sleep so the caller's ctx deadline fires and PushStreamConnection returns. |
| 282 | // After the sleep the caller may have grown the timeseries. |
| 283 | time.Sleep(s.sendDelay) |
| 284 | |
| 285 | // marshal into the pre-allocated buffer. |
| 286 | // Panics when actual data > size (the bug). |
| 287 | _, err := req.MarshalToSizedBuffer(buf) |
| 288 | return err |
| 289 | } |
| 290 | |
| 291 | func (s *slowSendStream) Recv() (*cortexpb.WriteResponse, error) { |
| 292 | return &cortexpb.WriteResponse{}, nil |
nothing calls this directly
no test coverage detected