Skip to content

Commit 9e67e60

Browse files
test: fix context leak warning
1 parent d111053 commit 9e67e60

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/clientinfo/observer_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ func TestObserve(t *testing.T) {
1111
return 5000
1212
}
1313
gauge := &Gauge{}
14-
ctx, _ := context.WithTimeout(context.Background(), 5*time.Millisecond)
14+
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Millisecond)
15+
defer cancel()
1516

1617
observer := &MetricObserver{input, gauge}
1718

0 commit comments

Comments
 (0)