MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / testFreeAddr

Function testFreeAddr

node/node_test.go:215–221  ·  view source on GitHub ↗

testFreeAddr claims a free port so we don't block on listener being ready.

(t *testing.T)

Source from the content-addressed store, hash-verified

213
214// testFreeAddr claims a free port so we don't block on listener being ready.
215func testFreeAddr(t *testing.T) string {
216 ln, err := net.Listen("tcp", "127.0.0.1:0")
217 require.NoError(t, err)
218 defer ln.Close()
219
220 return fmt.Sprintf("127.0.0.1:%d", ln.Addr().(*net.TCPAddr).Port)
221}
222
223// create a proposal block using real and full
224// mempool and evidence pool and validate it.

Callers 2

TestNodeSetPrivValTCPFunction · 0.85

Calls 3

ListenMethod · 0.65
CloseMethod · 0.65
AddrMethod · 0.45

Tested by

no test coverage detected