forked from quic-go/quic-go
integrationtests: fix proxy test on Windows (#4023)
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"net"
|
||||
"runtime"
|
||||
"runtime/pprof"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -68,7 +69,11 @@ var _ = Describe("QUIC Proxy", func() {
|
||||
addr, err := net.ResolveUDPAddr("udp", "localhost:"+strconv.Itoa(proxy.LocalPort()))
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
_, err = net.ListenUDP("udp", addr)
|
||||
if runtime.GOOS == "windows" {
|
||||
Expect(err).To(MatchError(fmt.Sprintf("listen udp 127.0.0.1:%d: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.", proxy.LocalPort())))
|
||||
} else {
|
||||
Expect(err).To(MatchError(fmt.Sprintf("listen udp 127.0.0.1:%d: bind: address already in use", proxy.LocalPort())))
|
||||
}
|
||||
Expect(proxy.Close()).To(Succeed()) // stopping is tested in the next test
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user