Skip to content

Commit

Permalink
pkg/sensors: rate limit test, avoid calling printf
Browse files Browse the repository at this point in the history
Use the output returned by Fatal instead of passing stuff to printf

Signed-off-by: Mahe Tardy <[email protected]>
  • Loading branch information
mtardy committed Jul 18, 2024
1 parent 58a7a7c commit 057d734
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/sensors/tracing/kprobe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5844,15 +5844,13 @@ spec:
// Generate 5 datagrams
socket, err := net.Dial("udp", "127.0.0.1:9468")
if err != nil {
fmt.Printf("ERROR dialing socket\n")
t.Fatal(err)
t.Fatalf("failed dialing socket: %s", err)
}

for i := 0; i < 5; i++ {
_, err := socket.Write([]byte("data"))
if err != nil {
fmt.Printf("ERROR writing to socket\n")
t.Fatal(err)
t.Fatalf("failed writing to socket: %s", err)
}
}

Expand Down

0 comments on commit 057d734

Please sign in to comment.