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

Function TestRunCheckerWithSkip

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

Source from the content-addressed store, hash-verified

849}
850
851func TestRunCheckerWithSkip(t *testing.T) {
852 config := vultureConfiguration{
853 tempoOrgID: "orgID",
854 tempoWriteBackoffDuration: time.Second,
855 }
856
857 logger = zap.NewNop()
858 ticker := time.NewTicker(time.Millisecond) // fires immediately
859 defer ticker.Stop()
860
861 // Checker function that signals completion
862 var checkerCalled bool
863 checker := func(_ *util.TraceInfo, _ *zap.Logger) {
864 checkerCalled = true
865 }
866
867 alwaysSkip := func(_ time.Time) (newStart, ts time.Time, skip bool) {
868 return time.Now(), time.Now(), true
869 }
870
871 runChecker(ticker, config, alwaysSkip, checker, logger)
872 time.Sleep(5 * time.Millisecond)
873 // Ensure the checker was not called due to skip=true
874 assert.False(t, checkerCalled)
875}
876
877func TestRunCheckerTraceNotReady(t *testing.T) {
878 seed := time.Date(2008, 1, 1, 12, 0, 0, 0, time.UTC)

Callers

nothing calls this directly

Calls 4

runCheckerFunction · 0.85
StopMethod · 0.65
NowMethod · 0.65
SleepMethod · 0.65

Tested by

no test coverage detected