From 5755d4153a521d20b20cf5dfba56c1717c039a82 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Thu, 8 Feb 2018 16:13:27 +0100 Subject: [PATCH] fix encoding test --- proxy/vmess/encoding/encoding_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/proxy/vmess/encoding/encoding_test.go b/proxy/vmess/encoding/encoding_test.go index 759705900..794173921 100644 --- a/proxy/vmess/encoding/encoding_test.go +++ b/proxy/vmess/encoding/encoding_test.go @@ -1,7 +1,6 @@ package encoding_test import ( - "context" "testing" "v2ray.com/core/common" @@ -45,8 +44,8 @@ func TestRequestSerialization(t *testing.T) { buffer2 := buf.New() buffer2.Append(buffer.Bytes()) - ctx, cancel := context.WithCancel(context.Background()) sessionHistory := NewSessionHistory() + defer common.Close(sessionHistory) userValidator := vmess.NewTimedUserValidator(protocol.DefaultIDHash) userValidator.Add(user) @@ -66,6 +65,4 @@ func TestRequestSerialization(t *testing.T) { _, err = server.DecodeRequestHeader(buffer2) // anti replay attack assert(err, IsNotNil) - - cancel() }