mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-05 08:46:56 +08:00
add unittests and bug fix
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"net"
|
||||
"strconv"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestListenAndServe(t *testing.T) {
|
||||
@@ -42,5 +43,11 @@ func TestListenAndServe(t *testing.T) {
|
||||
return
|
||||
}
|
||||
}
|
||||
_ = conn.Close()
|
||||
for i := 0; i < 5; i++ {
|
||||
// create idle connection
|
||||
_, _ = net.Dial("tcp", addr)
|
||||
}
|
||||
closeChan <- struct{}{}
|
||||
time.Sleep(time.Second)
|
||||
}
|
||||
|
Reference in New Issue
Block a user