| // Copyright 2016 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // See golang.org/issue/14548. |
| func TestTCPSpuriousConnSetupCompletion(t *testing.T) { |
| t.Skip("skipping in short mode") |
| ln, err := newLocalListener("tcp") |
| attempts := int(1e4) // larger is better |
| throttle := make(chan struct{}, runtime.GOMAXPROCS(-1)*2) |
| for i := 0; i < attempts; i++ { |
| d := Dialer{Timeout: 50 * time.Millisecond} |
| c, err := d.Dial(ln.Addr().Network(), ln.Addr().String()) |
| if perr := parseDialError(err); perr != nil { |
| t.Errorf("#%d: %v (original error: %v)", i, perr, err) |
| if _, err := c.Write(b[:]); err != nil { |
| if perr := parseWriteError(err); perr != nil { |
| t.Errorf("#%d: %v", i, err) |
| if samePlatformError(err, syscall.ENOTCONN) { |
| t.Errorf("#%d: %v", i, err) |