(t *testing.T, delay time.Duration)
| 467 | } |
| 468 | |
| 469 | func delayedResponseHTTPHandler(t *testing.T, delay time.Duration) http.HandlerFunc { |
| 470 | return func(w http.ResponseWriter, _ *http.Request) { |
| 471 | time.Sleep(delay) |
| 472 | |
| 473 | w.Header().Set("Content-Type", "application/x-protobuf") |
| 474 | b, err := proto.Marshal(&prompb.ReadResponse{}) |
| 475 | require.NoError(t, err) |
| 476 | |
| 477 | _, err = w.Write(snappy.Encode(nil, b)) |
| 478 | require.NoError(t, err) |
| 479 | } |
| 480 | } |
| 481 | |
| 482 | func TestReadMultipleErrorHandling(t *testing.T) { |
| 483 | m := &mockedRemoteClient{ |