Fix: module clash-test
This commit is contained in:
parent
34eeb58bfa
commit
7a406b991e
@ -8,6 +8,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
|
"net/netip"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
@ -38,7 +39,7 @@ const (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
waitTime = time.Second
|
waitTime = time.Second
|
||||||
localIP = net.ParseIP("127.0.0.1")
|
localIP = netip.MustParseAddr("127.0.0.1")
|
||||||
|
|
||||||
defaultExposedPorts = nat.PortSet{
|
defaultExposedPorts = nat.PortSet{
|
||||||
"10002/tcp": struct{}{},
|
"10002/tcp": struct{}{},
|
||||||
@ -67,10 +68,11 @@ func init() {
|
|||||||
C.SetHomeDir(homeDir)
|
C.SetHomeDir(homeDir)
|
||||||
|
|
||||||
if isDarwin {
|
if isDarwin {
|
||||||
localIP, err = defaultRouteIP()
|
routeIp, err := defaultRouteIP()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
localIP = netip.MustParseAddr(routeIp.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
c, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
|
c, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
|
||||||
@ -309,7 +311,7 @@ func testPingPongWithPacketConn(t *testing.T, pc net.PacketConn) error {
|
|||||||
}
|
}
|
||||||
defer l.Close()
|
defer l.Close()
|
||||||
|
|
||||||
rAddr := &net.UDPAddr{IP: localIP, Port: 10001}
|
rAddr := &net.UDPAddr{IP: localIP.AsSlice(), Port: 10001}
|
||||||
|
|
||||||
pingCh, pongCh, test := newPingPongPair()
|
pingCh, pongCh, test := newPingPongPair()
|
||||||
go func() {
|
go func() {
|
||||||
@ -448,7 +450,7 @@ func testLargeDataWithPacketConn(t *testing.T, pc net.PacketConn) error {
|
|||||||
}
|
}
|
||||||
defer l.Close()
|
defer l.Close()
|
||||||
|
|
||||||
rAddr := &net.UDPAddr{IP: localIP, Port: 10001}
|
rAddr := &net.UDPAddr{IP: localIP.AsSlice(), Port: 10001}
|
||||||
|
|
||||||
times := 50
|
times := 50
|
||||||
chunkSize := int64(1024)
|
chunkSize := int64(1024)
|
||||||
|
Reference in New Issue
Block a user