net: remove erroneous Dial check in TestListenerClose

This is a cherry-pick of
https://github.com/golang/go/commit/36db10f3cb916a1b97af3bfd4be7e3a2932185f8.

Original change's description:
> TestListenerClose had been asserting that a Dial to the newly-closed
> address always fails, on the assumption that the listener's address
> and port would not be reused by some other listener that could then
> accept the connection.
>
> As far as I can tell, that assumption is not valid: the Dial after
> Close may well connect to a Listener opened for some other test, or
> even one opened by a completely different process running concurrently
> on the same machine.
>
> Fixes #38700
>
> Change-Id: I925ed1b2ccb556135a2c5be0240d1789ed27d5fc
> Reviewed-on: https://go-review.googlesource.com/c/go/+/370666
> Trust: Bryan Mills <bcmills@google.com>
> Run-TryBot: Bryan Mills <bcmills@google.com>
> TryBot-Result: Gopher Robot <gobot@golang.org>
> Reviewed-by: Ian Lance Taylor <iant@golang.org>

Fixed: 98794
Change-Id: I05bc5c69b0ac56d856c96ab85a9526da4da3f982
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/go/+/672704
Fuchsia-Auto-Submit: Ghanan Gowripalan <ghanan@google.com>
Reviewed-by: Tamir Duberstein <tamird@google.com>
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
diff --git a/src/net/net_test.go b/src/net/net_test.go
index 33a7107..afa2d4e 100644
--- a/src/net/net_test.go
+++ b/src/net/net_test.go
@@ -244,7 +244,6 @@
 				defer os.Remove(ln.Addr().String())
 			}
 
-			dst := ln.Addr().String()
 			if err := ln.Close(); err != nil {
 				if perr := parseCloseError(err, false); perr != nil {
 					t.Error(perr)
@@ -257,28 +256,12 @@
 				t.Fatal("should fail")
 			}
 
-			if network == "tcp" {
-				// We will have two TCP FSMs inside the
-				// kernel here. There's no guarantee that a
-				// signal comes from the far end FSM will be
-				// delivered immediately to the near end FSM,
-				// especially on the platforms that allow
-				// multiple consumer threads to pull pending
-				// established connections at the same time by
-				// enabling SO_REUSEPORT option such as Linux,
-				// DragonFly BSD. So we need to give some time
-				// quantum to the kernel.
-				//
-				// Note that net.inet.tcp.reuseport_ext=1 by
-				// default on DragonFly BSD.
-				time.Sleep(time.Millisecond)
-
-				cc, err := Dial("tcp", dst)
-				if err == nil {
-					t.Error("Dial to closed TCP listener succeeded.")
-					cc.Close()
-				}
-			}
+			// Note: we cannot ensure that a subsequent Dial does not succeed, because
+			// we do not in general have any guarantee that ln.Addr is not immediately
+			// reused. (TCP sockets enter a TIME_WAIT state when closed, but that only
+			// applies to existing connections for the port — it does not prevent the
+			// port itself from being used for entirely new connections in the
+			// meantime.)
 		})
 	}
 }