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

Function TestDoWrite

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

Source from the content-addressed store, hash-verified

231}
232
233func TestDoWrite(t *testing.T) {
234 mockJaegerClient := MockReporter{err: nil}
235 // Define the configuration
236 config := vultureConfiguration{
237 tempoOrgID: "orgID",
238 tempoWriteBackoffDuration: time.Second,
239 }
240
241 ticker := time.NewTicker(10 * time.Millisecond)
242 logger = zap.NewNop()
243
244 doWrite(&mockJaegerClient, ticker, config.tempoWriteBackoffDuration, config, logger)
245
246 time.Sleep(time.Second)
247 ticker.Stop()
248 assert.Greater(t, len(mockJaegerClient.GetEmittedBatches()), 0)
249}
250
251func TestDoWriteWithError(t *testing.T) {
252 mockJaegerClient := MockReporter{err: errors.New("an error")}

Callers

nothing calls this directly

Calls 4

GetEmittedBatchesMethod · 0.95
doWriteFunction · 0.85
SleepMethod · 0.65
StopMethod · 0.65

Tested by

no test coverage detected