Add TxPipeline race test

This commit is contained in:
Vladimir Mihailenco 2018-02-20 10:05:11 +02:00
parent fa7f64f7f2
commit fd2200b051
1 changed files with 15 additions and 0 deletions

View File

@ -243,6 +243,21 @@ var _ = Describe("races", func() {
Expect(err).NotTo(HaveOccurred()) Expect(err).NotTo(HaveOccurred())
Expect(n).To(Equal(int64(N))) 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 { func bigVal() []byte {