MCPcopy
hub / github.com/prometheus/prometheus / delayedResponseHTTPHandler

Function delayedResponseHTTPHandler

storage/remote/client_test.go:469–480  ·  view source on GitHub ↗
(t *testing.T, delay time.Duration)

Source from the content-addressed store, hash-verified

467}
468
469func 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
482func TestReadMultipleErrorHandling(t *testing.T) {
483 m := &mockedRemoteClient{

Callers 1

TestReadClientFunction · 0.85

Calls 5

HeaderMethod · 0.80
SetMethod · 0.65
WriteMethod · 0.65
EncodeMethod · 0.65
MarshalMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…