fix ring test `supports Process hook` data race

Signed-off-by: monkey <golang@88.com>
This commit is contained in:
monkey 2021-03-07 17:10:19 +08:00
parent f3a31a3e2c
commit 783725f3f7
1 changed files with 6 additions and 0 deletions

View File

@ -189,6 +189,12 @@ var _ = Describe("Redis Ring", func() {
})
It("supports Process hook", func() {
//the health check leads to data race for variable "stack []string".
//here, the health check time is set to 72 hours to avoid health check
opt := redisRingOptions()
opt.HeartbeatFrequency = 72 * time.Hour
ring = redis.NewRing(opt)
err := ring.Ping(ctx).Err()
Expect(err).NotTo(HaveOccurred())