Merge pull request #1672 from monkey92t/test_error

solve possible unit test errors in ring_test.go
This commit is contained in:
Vladimir Mihailenco 2021-02-25 09:03:53 +02:00 committed by GitHub
commit 00eeb1cb09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -533,6 +533,16 @@ var _ = Describe("Ring watch", func() {
}) })
It("respects max size on multi", func() { It("respects max size on multi", func() {
//this test checks the number of "pool.conn"
//if the health check is performed at the same time
//conn will be used, resulting in an abnormal number of "pool.conn".
//
//redis.NewRing() does not have an option to prohibit health checks.
//set a relatively large time here to avoid health checks.
opt := redisRingOptions()
opt.HeartbeatFrequency = 72 * time.Hour
ring = redis.NewRing(opt)
perform(1000, func(id int) { perform(1000, func(id int) {
var ping *redis.StatusCmd var ping *redis.StatusCmd