Browse Source

make error less sensitive

Shelikhoo 5 years ago
parent
commit
b610fc0a70
1 changed files with 4 additions and 3 deletions
  1. 4 3
      transport/internet/headers/http/http_test.go

+ 4 - 3
transport/internet/headers/http/http_test.go

@@ -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 {
-			t.Error("Unexpected Error", err)
+		if err == nil {
+			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) {