mirror of https://github.com/go-redis/redis.git
Merge pull request #1688 from monkey92t/data_race
fix ring test `Process hook` data race
This commit is contained in:
commit
7633aded81
|
@ -188,6 +188,14 @@ var _ = Describe("Redis Ring", func() {
|
|||
})
|
||||
})
|
||||
|
||||
Describe("Process hook", func() {
|
||||
BeforeEach(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)
|
||||
})
|
||||
It("supports Process hook", func() {
|
||||
err := ring.Ping(ctx).Err()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
@ -336,6 +344,7 @@ var _ = Describe("Redis Ring", func() {
|
|||
"ring.AfterProcessPipeline",
|
||||
}))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
var _ = Describe("empty Redis Ring", func() {
|
||||
|
|
Loading…
Reference in New Issue