Skip to content

Commit

Permalink
integrationtests: fix proxy test on Windows (#4023)
Browse files Browse the repository at this point in the history
  • Loading branch information
egonelbre committed Aug 13, 2023
1 parent 05db808 commit b65ed61
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion integrationtests/tools/proxy/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"fmt"
"net"
"runtime"
"runtime/pprof"
"strconv"
"strings"
Expand Down Expand Up @@ -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)
Expect(err).To(MatchError(fmt.Sprintf("listen udp 127.0.0.1:%d: bind: address already in use", proxy.LocalPort())))
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
})

Expand Down

0 comments on commit b65ed61

Please sign in to comment.