MCPcopy
hub / github.com/grafana/tempo / fakeServer

Function fakeServer

tempodb/backend/s3/s3_test.go:382–395  ·  view source on GitHub ↗
(t *testing.T, returnIn time.Duration, counter *int32)

Source from the content-addressed store, hash-verified

380}
381
382func fakeServer(t *testing.T, returnIn time.Duration, counter *int32) *httptest.Server {
383 server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
384 time.Sleep(returnIn)
385
386 atomic.AddInt32(counter, 1)
387 // return fake list response b/c it's the only call that has to succeed
388 _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
389 <ListBucketResult>
390 </ListBucketResult>`))
391 }))
392 t.Cleanup(server.Close)
393
394 return server
395}
396
397func TestReadError(t *testing.T) {
398 errA := minio.ErrorResponse{

Callers 2

TestHedgeFunction · 0.70
TestRetryConfigurationFunction · 0.70

Calls 2

SleepMethod · 0.65
WriteMethod · 0.65

Tested by

no test coverage detected