@@ -27,7 +27,12 @@ func GetFreePortForTesting() (int, error) {
|
||||
defer l.Close()
|
||||
|
||||
// Get the port that was assigned by the OS
|
||||
return l.Addr().(*net.TCPAddr).Port, nil
|
||||
addr, ok := l.Addr().(*net.TCPAddr)
|
||||
if !ok {
|
||||
return 0, fmt.Errorf("failed to parse TCP address")
|
||||
}
|
||||
|
||||
return addr.Port, nil
|
||||
}
|
||||
|
||||
func TestMetricsIntegration(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user