bug fix: do not client during closing

This commit is contained in:
finley
2022-07-04 20:50:16 +08:00
parent 5c85295b02
commit 9e155a617c
2 changed files with 23 additions and 4 deletions

View File

@@ -3,7 +3,9 @@ package client
import (
"bytes"
"github.com/hdt3213/godis/lib/logger"
"github.com/hdt3213/godis/lib/utils"
"github.com/hdt3213/godis/redis/protocol"
"github.com/hdt3213/godis/redis/protocol/asserts"
"strconv"
"testing"
"time"
@@ -105,6 +107,8 @@ func TestClient(t *testing.T) {
}
client.Close()
ret := client.Send(utils.ToCmdLine("ping"))
asserts.AssertErrReply(t, ret, "client closed")
}
func TestReconnect(t *testing.T) {
@@ -135,7 +139,4 @@ func TestReconnect(t *testing.T) {
if !success {
t.Error("reconnect error")
}
//var wg sync.WaitGroup
//wg.Add(1)
//wg.Wait()
}