Skip to content

Commit

Permalink
fix: add tracer field for test to avoid nil pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
lvlcn-t committed Sep 9, 2024
1 parent 5971b0d commit 65a4aa9
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions pkg/checks/traceroute/check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/caas-team/sparrow/pkg/checks"
"github.com/google/go-cmp/cmp"
"go.opentelemetry.io/otel"
)

func TestCheck(t *testing.T) {
Expand Down Expand Up @@ -60,16 +61,11 @@ func newForTest(f tracerouteFactory, maxHops int, targets []string) *Traceroute
t[i] = Target{Addr: target}
}
return &Traceroute{
config: Config{
Targets: t,
MaxHops: maxHops,
},
CheckBase: checks.CheckBase{Mu: sync.Mutex{}, DoneChan: make(chan struct{})},
config: Config{Targets: t, MaxHops: maxHops},
traceroute: f,
metrics: newMetrics(),
CheckBase: checks.CheckBase{
Mu: sync.Mutex{},
DoneChan: make(chan struct{}),
},
tracer: otel.Tracer("tracer.traceroute"),
}
}

Expand Down

0 comments on commit 65a4aa9

Please sign in to comment.