mirror of
https://github.com/golang/net.git
synced 2026-04-01 02:47:08 +09:00
netutil: deflake TestLimitListener (again)
This change adds missing accept-queue length check. Change-Id: Ifefc5c614a1a34af51411976ced096c55b95fb8f Reviewed-on: https://go-review.googlesource.com/11536 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
@@ -27,6 +27,9 @@ import (
|
||||
func TestLimitListener(t *testing.T) {
|
||||
const max = 5
|
||||
attempts := (nettest.MaxOpenFiles() - max) / 2
|
||||
if attempts > 256 { // maximum length of accept queue is 128 by default
|
||||
attempts = 256
|
||||
}
|
||||
|
||||
l, err := net.Listen("tcp", "127.0.0.1:0")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user