1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 08:32:40 +08:00
This commit is contained in:
2023-10-26 14:42:56 +08:00
parent 0d124c0b79
commit 91a5a7d612
8 changed files with 160 additions and 53 deletions

View File

@ -3,6 +3,7 @@ package redis_test
import (
"context"
"fmt"
"strconv"
"sync"
"testing"
"time"
@ -133,3 +134,18 @@ func TestPubSub(t *testing.T) {
})
}
func TestRedisPool(t *testing.T) {
tests.RunOnRedis(t, func(client redis.Client) {
defer client.Close()
err := client.ConfigSet(context.Background(), "slowlog-log-slower-than", strconv.FormatInt(int64(time.Microsecond)*5, 10)).Err()
assert.Nil(t, err, err)
t.Log(client.ConfigGet(context.Background(), "slowlog-log-slower-than").Result())
}, redis.ReidsOption{
Addr: "192.168.123.100:6379",
PoolSize: 100,
PoolFIFO: true,
})
}