mirror of https://github.com/go-redis/redis.git
Add TxPipeline race test
This commit is contained in:
parent
fa7f64f7f2
commit
fd2200b051
15
race_test.go
15
race_test.go
|
@ -243,6 +243,21 @@ var _ = Describe("races", func() {
|
|||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(n).To(Equal(int64(N)))
|
||||
})
|
||||
|
||||
It("should TxPipeline", func() {
|
||||
pipe := client.TxPipeline()
|
||||
perform(N, func(id int) {
|
||||
pipe.Incr("key")
|
||||
})
|
||||
|
||||
cmds, err := pipe.Exec()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(cmds).To(HaveLen(N))
|
||||
|
||||
n, err := client.Get("key").Int64()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(n).To(Equal(int64(N)))
|
||||
})
|
||||
})
|
||||
|
||||
func bigVal() []byte {
|
||||
|
|
Loading…
Reference in New Issue