1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 01:57:12 -05:00

make error less sensitive

This commit is contained in:
Shelikhoo 2020-06-03 16:32:58 +08:00
parent d31a067fc3
commit b610fc0a70
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316

View File

@ -5,7 +5,6 @@ import (
"bytes" "bytes"
"context" "context"
"crypto/rand" "crypto/rand"
"io"
"strings" "strings"
"testing" "testing"
"time" "time"
@ -247,8 +246,10 @@ func TestConnectionInvPath(t *testing.T) {
totalBytes := 0 totalBytes := 0
for { for {
n, err := authConn.Read(actualResponse[totalBytes:]) n, err := authConn.Read(actualResponse[totalBytes:])
if err != io.EOF { if err == nil {
t.Error("Unexpected Error", err) t.Error("Error Expected", err)
} else {
return
} }
totalBytes += n totalBytes += n
if totalBytes >= len(expectedResponse) || time.Now().After(deadline) { if totalBytes >= len(expectedResponse) || time.Now().After(deadline) {