Skip to content

Commit

Permalink
internal/socket: use larger buffers in race test
Browse files Browse the repository at this point in the history
The race detector doesn't seem to track races at the byte level.
Use a larger buffer to make the test more reliable.

Fixes golang/go#37338

Change-Id: I275db68a5c206b58c3bc48b9f5c1e22ee1aff176
Reviewed-on: https://go-review.googlesource.com/c/net/+/312529
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
  • Loading branch information
ianlancetaylor committed Apr 21, 2021
1 parent 2554d15 commit 4e50805
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/socket/socket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ func main() {
}
cc := ipv4.NewPacketConn(c)
sync := make(chan bool)
src := make([]byte, 1)
dst := make([]byte, 1)
src := make([]byte, 100)
dst := make([]byte, 100)
go func() {
if _, err := cc.WriteTo(src, nil, c.LocalAddr()); err != nil {
log.Fatalf("WriteTo: %v", err)
Expand Down Expand Up @@ -358,8 +358,8 @@ func main() {
}
cc := ipv4.NewPacketConn(c)
sync := make(chan bool)
src := make([]byte, 1)
dst := make([]byte, 1)
src := make([]byte, 100)
dst := make([]byte, 100)
go func() {
if _, err := cc.WriteTo(src, nil, c.LocalAddr()); err != nil {
log.Fatalf("WriteTo: %v", err)
Expand Down

0 comments on commit 4e50805

Please sign in to comment.