Skip to content

Commit

Permalink
net: fix garbage connection close in dual stack tests
Browse files Browse the repository at this point in the history
This may possibly be the root cause of flaky dual stack tests.

Update #4176
Update #5001

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13050043
  • Loading branch information
cixtor committed Aug 17, 2013
1 parent 96d7997 commit ca01ab3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pkg/net/unicast_posix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,12 +349,16 @@ func checkDualStackSecondListener(t *testing.T, net, laddr string, xerr, err err
if xerr == nil && err != nil || xerr != nil && err == nil {
t.Fatalf("Second Listen(%q, %q) returns %v, expected %v", net, laddr, err, xerr)
}
l.(*TCPListener).Close()
if err == nil {
l.(*TCPListener).Close()
}
case "udp", "udp4", "udp6":
if xerr == nil && err != nil || xerr != nil && err == nil {
t.Fatalf("Second ListenPacket(%q, %q) returns %v, expected %v", net, laddr, err, xerr)
}
l.(*UDPConn).Close()
if err == nil {
l.(*UDPConn).Close()
}
default:
t.Fatalf("Unexpected network: %q", net)
}
Expand Down

0 comments on commit ca01ab3

Please sign in to comment.