Merge pull request #1688 from monkey92t/data_race

fix ring test `Process hook` data race
This commit is contained in:
Vladimir Mihailenco 2021-03-08 10:51:28 +02:00 committed by GitHub
commit 7633aded81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 117 additions and 108 deletions

View File

@ -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() { It("supports Process hook", func() {
err := ring.Ping(ctx).Err() err := ring.Ping(ctx).Err()
Expect(err).NotTo(HaveOccurred()) Expect(err).NotTo(HaveOccurred())
@ -336,6 +344,7 @@ var _ = Describe("Redis Ring", func() {
"ring.AfterProcessPipeline", "ring.AfterProcessPipeline",
})) }))
}) })
})
}) })
var _ = Describe("empty Redis Ring", func() { var _ = Describe("empty Redis Ring", func() {