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

Function TestTraceIsReady

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

Source from the content-addressed store, hash-verified

215}
216
217func TestTraceIsReady(t *testing.T) {
218 writeBackoff := 1 * time.Second
219 longWriteBackoff := 5 * time.Second
220 seed := time.Date(2008, 1, 1, 12, 0, 0, 0, time.UTC)
221 ti := util.NewTraceInfo(seed, "test")
222
223 startTime := time.Date(2009, 1, 1, 12, 0, 0, 0, time.UTC)
224 ready := traceIsReady(ti, time.Now(), startTime, writeBackoff, longWriteBackoff)
225
226 assert.False(t, ready, "trace should not be ready yet")
227
228 startTime = time.Date(2007, 1, 1, 12, 0, 0, 0, time.UTC)
229 ready = traceIsReady(ti, seed.Add(5*longWriteBackoff), startTime, writeBackoff, longWriteBackoff)
230 assert.True(t, ready, "trace should be ready now")
231}
232
233func TestDoWrite(t *testing.T) {
234 mockJaegerClient := MockReporter{err: nil}

Callers

nothing calls this directly

Calls 4

NewTraceInfoFunction · 0.92
traceIsReadyFunction · 0.85
NowMethod · 0.65
AddMethod · 0.65

Tested by

no test coverage detected