MCPcopy Index your code
hub / github.com/zalando/skipper / FindAddress

Function FindAddress

skipper_test.go:82–102  ·  view source on GitHub ↗

skipper.FindAddress returns an addr that you can listen on TCP. You need to hold skipper.MuFindAddress to call this function.

(t *testing.T)

Source from the content-addressed store, hash-verified

80// skipper.FindAddress returns an addr that you can listen on TCP. You need to
81// hold skipper.MuFindAddress to call this function.
82func FindAddress(t *testing.T) string {
83 t.Helper()
84
85 var (
86 err error
87 l *net.TCPListener
88 )
89 for range 3 {
90 l, err = net.ListenTCP("tcp6", &net.TCPAddr{})
91 if err == nil {
92 break
93 }
94 }
95 require.NoError(t, err)
96
97 addr := l.Addr().String()
98 require.NoError(t, l.Close())
99 t.Logf("Found address %q to be free", addr)
100
101 return addr
102}
103
104func TestOptionsFilterRegistry(t *testing.T) {
105 t.Run("custom filters", func(t *testing.T) {

Calls 3

StringMethod · 0.65
CloseMethod · 0.65
AddrMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…