From 7bc45eb8aa5a4ecb3b0bcf6ce8c96cf58d663162 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Sat, 25 Aug 2018 15:59:35 +0200 Subject: [PATCH] update commander test --- testing/scenarios/command_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/testing/scenarios/command_test.go b/testing/scenarios/command_test.go index 69d6b49cb..bf498dd53 100644 --- a/testing/scenarios/command_test.go +++ b/testing/scenarios/command_test.go @@ -502,6 +502,7 @@ func TestCommanderStats(t *testing.T) { Port: int(clientPort), }) assert(err, IsNil) + defer conn.Close() // nolint: errcheck payload := make([]byte, 10240*1024) rand.Read(payload) @@ -511,8 +512,9 @@ func TestCommanderStats(t *testing.T) { assert(nBytes, Equals, len(payload)) response := readFrom(conn, time.Second*20, 10240*1024) - assert(response, Equals, xor([]byte(payload))) - assert(conn.Close(), IsNil) + if err := compare.BytesEqualWithDetail(response, xor([]byte(payload))); err != nil { + t.Fatal("failed to read response: ", err) + } cmdConn, err := grpc.Dial(fmt.Sprintf("127.0.0.1:%d", cmdPort), grpc.WithInsecure(), grpc.WithBlock()) assert(err, IsNil)