mirror of
https://github.com/redis/go-redis.git
synced 2025-08-06 01:35:48 +03:00
fix: remove mutex from pipeline
This commit is contained in:
47
race_test.go
47
race_test.go
@@ -214,53 +214,6 @@ var _ = Describe("races", func() {
|
||||
Expect(val).To(Equal(int64(C * N)))
|
||||
})
|
||||
|
||||
It("should Pipeline", func() {
|
||||
perform(C, func(id int) {
|
||||
pipe := client.Pipeline()
|
||||
for i := 0; i < N; i++ {
|
||||
pipe.Echo(ctx, fmt.Sprint(i))
|
||||
}
|
||||
|
||||
cmds, err := pipe.Exec(ctx)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(cmds).To(HaveLen(N))
|
||||
|
||||
for i := 0; i < N; i++ {
|
||||
Expect(cmds[i].(*redis.StringCmd).Val()).To(Equal(fmt.Sprint(i)))
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
It("should Pipeline", func() {
|
||||
pipe := client.Pipeline()
|
||||
perform(N, func(id int) {
|
||||
pipe.Incr(ctx, "key")
|
||||
})
|
||||
|
||||
cmds, err := pipe.Exec(ctx)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(cmds).To(HaveLen(N))
|
||||
|
||||
n, err := client.Get(ctx, "key").Int64()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(n).To(Equal(int64(N)))
|
||||
})
|
||||
|
||||
It("should TxPipeline", func() {
|
||||
pipe := client.TxPipeline()
|
||||
perform(N, func(id int) {
|
||||
pipe.Incr(ctx, "key")
|
||||
})
|
||||
|
||||
cmds, err := pipe.Exec(ctx)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(cmds).To(HaveLen(N))
|
||||
|
||||
n, err := client.Get(ctx, "key").Int64()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(n).To(Equal(int64(N)))
|
||||
})
|
||||
|
||||
PIt("should BLPop", func() {
|
||||
var received uint32
|
||||
|
||||
|
Reference in New Issue
Block a user