net: remove arbitrary deadlines in PacketConn tests

When TestPacketConn was added (in CL 6501057) it included arbitrary
100ms deadlines. Those deadlines were arbitrarily increased to 500ms
in CL 4922.

If the test is actually provoking a deadlock, allowing it to deadlock
will give us a more useful goroutine dump. Otherwise, the deadlines
don't seem all that useful — they appear to increase code coverage,
but have no effect on the test in the typical case, and can only
cause flakes on particularly-slow machines.

For #43627

Change-Id: I83de5217c54c743b83adddf51d4f6f2bd5b91732
Reviewed-on: https://go-review.googlesource.com/c/go/+/368215
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/src/net/packetconn_test.go b/src/net/packetconn_test.go
index b3b1715..487912e 100644
--- a/src/net/packetconn_test.go
+++ b/src/net/packetconn_test.go
@@ -12,7 +12,6 @@
 import (
 	"os"
 	"testing"
-	"time"
 )
 
 // The full stack test cases for IPConn have been moved to the
@@ -60,9 +59,6 @@
 		}
 		defer closer(c1, tt.net, tt.addr1, tt.addr2)
 		c1.LocalAddr()
-		c1.SetDeadline(time.Now().Add(500 * time.Millisecond))
-		c1.SetReadDeadline(time.Now().Add(500 * time.Millisecond))
-		c1.SetWriteDeadline(time.Now().Add(500 * time.Millisecond))
 
 		c2, err := ListenPacket(tt.net, tt.addr2)
 		if err != nil {
@@ -70,9 +66,6 @@
 		}
 		defer closer(c2, tt.net, tt.addr1, tt.addr2)
 		c2.LocalAddr()
-		c2.SetDeadline(time.Now().Add(500 * time.Millisecond))
-		c2.SetReadDeadline(time.Now().Add(500 * time.Millisecond))
-		c2.SetWriteDeadline(time.Now().Add(500 * time.Millisecond))
 		rb2 := make([]byte, 128)
 
 		if _, err := c1.WriteTo(wb, c2.LocalAddr()); err != nil {
@@ -115,9 +108,6 @@
 		}
 		defer closer(c1, tt.net, tt.addr1, tt.addr2)
 		c1.LocalAddr()
-		c1.SetDeadline(time.Now().Add(500 * time.Millisecond))
-		c1.SetReadDeadline(time.Now().Add(500 * time.Millisecond))
-		c1.SetWriteDeadline(time.Now().Add(500 * time.Millisecond))
 
 		c2, err := Dial(tt.net, c1.LocalAddr().String())
 		if err != nil {
@@ -126,9 +116,6 @@
 		defer c2.Close()
 		c2.LocalAddr()
 		c2.RemoteAddr()
-		c2.SetDeadline(time.Now().Add(500 * time.Millisecond))
-		c2.SetReadDeadline(time.Now().Add(500 * time.Millisecond))
-		c2.SetWriteDeadline(time.Now().Add(500 * time.Millisecond))
 
 		if _, err := c2.Write(wb); err != nil {
 			t.Fatal(err)