Skip to content

Commit

Permalink
Fix TestLogPropagators setup to account for agent communicaition logs
Browse files Browse the repository at this point in the history
  • Loading branch information
mtoffl01 committed Oct 15, 2024
1 parent 769b27e commit bb1e793
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions ddtrace/tracer/log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,18 @@ func (p *prop) Extract(carrier interface{}) (sctx ddtrace.SpanContext, e error)
func setup(t *testing.T, customProp Propagator) string {
tp := new(log.RecordLogger)
var tracer *tracer
var stop func()
if customProp != nil {
tracer = newTracer(WithLogger(tp), WithPropagator(customProp))
tracer, _, _, stop = startTestTracer(t, WithLogger(tp), WithPropagator(customProp))
// tracer = newTracer(WithLogger(tp), WithPropagator(customProp))
} else {
tracer = newTracer(WithLogger(tp))
tracer, _, _, stop = startTestTracer(t, WithLogger(tp))
// tracer = newTracer(WithLogger(tp))
}
defer tracer.Stop()
defer stop()
tp.Reset()
tp.Ignore("appsec: ", telemetry.LogPrefix)
logStartup(tracer)
require.Len(t, tp.Logs(), 1)
return tp.Logs()[0]
require.Len(t, tp.Logs(), 2)
return tp.Logs()[1]
}

0 comments on commit bb1e793

Please sign in to comment.