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

Function TestTraceInfo

pkg/util/trace_info_test.go:15–25  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13const testSeed = 1632146180
14
15func TestTraceInfo(t *testing.T) {
16 writeBackoff := 1 * time.Second
17 longWriteBackoff := 5 * time.Second
18
19 seed := time.Unix(0, testSeed)
20 info := NewTraceInfo(seed, "")
21 assert.False(t, info.Ready(seed, writeBackoff, longWriteBackoff))
22 assert.False(t, info.Ready(seed.Add(longWriteBackoff), writeBackoff, longWriteBackoff))
23 assert.False(t, info.Ready(seed.Add(longWriteBackoff).Add(1*time.Second), writeBackoff, longWriteBackoff))
24 assert.True(t, info.Ready(seed.Add(2*longWriteBackoff), writeBackoff, longWriteBackoff))
25}
26
27func TestGenerateRandomLogs(t *testing.T) {
28 now := time.Now()

Callers

nothing calls this directly

Calls 3

ReadyMethod · 0.95
NewTraceInfoFunction · 0.85
AddMethod · 0.65

Tested by

no test coverage detected