Skip to content

Commit d3b0783

Browse files
committed
fix(tests): close socket listener in GetRandomPort()
1 parent f3e7368 commit d3b0783

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

tests/utils/utils.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ func Append(slice []string, data string) []string {
5454

5555
func GetRandomPort() string {
5656
l, _ := net.Listen("tcp", "127.0.0.1:0") // listen on localhost
57+
defer l.Close()
5758
port := l.Addr()
5859
return strings.Split(port.String(), ":")[1]
5960
}

0 commit comments

Comments
 (0)