Skip to content

Commit 00eeb1c

Browse files
authored
Merge pull request #1672 from monkey92t/test_error
solve possible unit test errors in ring_test.go
2 parents e5cde8f + f4ae0ba commit 00eeb1c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ring_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,16 @@ var _ = Describe("Ring watch", func() {
533533
})
534534

535535
It("respects max size on multi", func() {
536+
//this test checks the number of "pool.conn"
537+
//if the health check is performed at the same time
538+
//conn will be used, resulting in an abnormal number of "pool.conn".
539+
//
540+
//redis.NewRing() does not have an option to prohibit health checks.
541+
//set a relatively large time here to avoid health checks.
542+
opt := redisRingOptions()
543+
opt.HeartbeatFrequency = 72 * time.Hour
544+
ring = redis.NewRing(opt)
545+
536546
perform(1000, func(id int) {
537547
var ping *redis.StatusCmd
538548

0 commit comments

Comments
 (0)