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

Function TestDoReadForAnErroredRead

cmd/tempo-vulture/main_test.go:411–429  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

409}
410
411func TestDoReadForAnErroredRead(t *testing.T) {
412 seed := time.Date(2008, 1, 1, 12, 0, 0, 0, time.UTC)
413 traceInfo := util.NewTraceInfo(seed, "test")
414
415 trace, _ := traceInfo.ConstructTraceFromEpoch()
416
417 // Define the configuration
418 config := vultureConfiguration{
419 tempoOrgID: "orgID",
420 tempoWriteBackoffDuration: time.Second,
421 }
422
423 logger = zap.NewNop()
424
425 // Assert a read with errors
426 mockHTTPClient := MockHTTPClient{err: errors.New("an error"), traceResp: trace}
427 doRead(&mockHTTPClient, config, traceInfo, logger)
428 assert.Equal(t, 1, mockHTTPClient.GetRequestsCount())
429}
430
431func TestSearchTraceql(t *testing.T) {
432 seed := time.Date(2008, 1, 1, 12, 0, 0, 0, time.UTC)

Callers

nothing calls this directly

Calls 5

GetRequestsCountMethod · 0.95
NewTraceInfoFunction · 0.92
doReadFunction · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected