mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-22 23:13:01 +00:00
Try to fix infinite conn read in tests
This commit is contained in:
parent
c6a57b2cc1
commit
60b2c349d2
@ -28,6 +28,7 @@ func Test_listenHTTPUpgradeAndDial(t *testing.T) {
|
|||||||
defer c.Close()
|
defer c.Close()
|
||||||
|
|
||||||
var b [1024]byte
|
var b [1024]byte
|
||||||
|
c.SetReadDeadline(time.Now().Add(2 * time.Second))
|
||||||
_, err := c.Read(b[:])
|
_, err := c.Read(b[:])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
@ -87,6 +88,7 @@ func Test_listenHTTPUpgradeAndDialWithHeaders(t *testing.T) {
|
|||||||
defer c.Close()
|
defer c.Close()
|
||||||
|
|
||||||
var b [1024]byte
|
var b [1024]byte
|
||||||
|
c.SetReadDeadline(time.Now().Add(2 * time.Second))
|
||||||
_, err := c.Read(b[:])
|
_, err := c.Read(b[:])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
@ -33,6 +33,7 @@ func Test_listenSHAndDial(t *testing.T) {
|
|||||||
defer c.Close()
|
defer c.Close()
|
||||||
|
|
||||||
var b [1024]byte
|
var b [1024]byte
|
||||||
|
c.SetReadDeadline(time.Now().Add(2 * time.Second))
|
||||||
_, err := c.Read(b[:])
|
_, err := c.Read(b[:])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
@ -28,6 +28,7 @@ func Test_listenWSAndDial(t *testing.T) {
|
|||||||
defer c.Close()
|
defer c.Close()
|
||||||
|
|
||||||
var b [1024]byte
|
var b [1024]byte
|
||||||
|
c.SetReadDeadline(time.Now().Add(2 * time.Second))
|
||||||
_, err := c.Read(b[:])
|
_, err := c.Read(b[:])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user