From 783725f3f7a274e14821dbdaaee06722cd855f5b Mon Sep 17 00:00:00 2001 From: monkey Date: Sun, 7 Mar 2021 17:10:19 +0800 Subject: [PATCH] fix ring test `supports Process hook` data race Signed-off-by: monkey --- ring_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ring_test.go b/ring_test.go index 6ec1ff84..f950f617 100644 --- a/ring_test.go +++ b/ring_test.go @@ -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())